maxveldink / sorbet-result

Adds T::Result as a basic, strongly-typed monad
MIT License
23 stars 2 forks source link

Adds on_error method for easier error handling during chaining #26

Closed maxveldink closed 1 year ago

maxveldink commented 1 year ago

Introduces an on_error method for easier error handling when chaining Results. It will only execute the block if called on a Failure type and the Error is given to the block for processing.

Example usages here include logging or capturing an error in error monitoring software.

Closes #15

maxveldink commented 1 year ago

I'm not sure we need to update the type_checker tests for this method; it's fairly straight forward. Any thoughts about that @iMacTia ?