You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm trying to introduce returns to my new side-project, but it's a bit hard to wrap my head around this library after working for years with OOP.
What I want to do specifically is to implement top-level error handling, where I implement some my_error_handler_func to be composed with IOResult that could contain result of domain logic (let say it's str), or some DomainError, according to given schema (where -> means some method of composition, and => means returning result)
Important: I would like my_error_handler_func to have access to all of the context necessary to debug the error, if result is IOFailure (so I guess my_error_handler_func should have access to both DomainError itself and IOResult.trace)
What would be recommended way of implementing that?
The text was updated successfully, but these errors were encountered:
Additional question - what would be recommended way of turning IOResult[str, DomainError] into IO[str] if result is IOSuccess[str] or to run my_error_handler_func if result is 'IOFailure[DomainError]`?
Hello!
I'm trying to introduce
returns
to my new side-project, but it's a bit hard to wrap my head around this library after working for years with OOP.What I want to do specifically is to implement top-level error handling, where I implement some
my_error_handler_func
to be composed withIOResult
that could contain result of domain logic (let say it'sstr
), or someDomainError
, according to given schema (where->
means some method of composition, and=>
means returning result)Important: I would like
my_error_handler_func
to have access to all of the context necessary to debug the error, if result isIOFailure
(so I guessmy_error_handler_func
should have access to bothDomainError
itself andIOResult.trace
)What would be recommended way of implementing that?
The text was updated successfully, but these errors were encountered: