-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
refactoring 🛠️Code refactoring and enhancementsCode refactoring and enhancements
Description
Why
The error system in the STM library is hard to understand and maintain. It needs to be refactored with the best practices used in the Mithril nodes which are specified in this ADR.
What
Refactor the errors in the STM library according to best practices.
How
- Create a new
StdResult<T>type in STM library which is an alias ofanyhow::Result<T> - Update the return types of functions to
StdResult:- Keep using the
thiserrortyped error in the functions - Add some
anyhowcontext when necessary (e.g. if a function is called at multiple places) - Adapt tests to support testing a downcasted
anyhowerror to athiserrortyped error (a macro could help)
- Keep using the
- Remove the
From/Intoimplementations for typed errors - Remove the unneeded variants of typed errors if any
Metadata
Metadata
Assignees
Labels
refactoring 🛠️Code refactoring and enhancementsCode refactoring and enhancements