Try / MapTry with ErrorHandler for specific Exceptions #605
NormanMann
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With MapTry I can provide an errorhandler that is supposed to convert the exception in an error or error string. In my case I only want to deal with certain exceptions (e.g. OdbcException) and turn them into beautified errors. All other exceptions should just throw.
While I could use 'throw ex' in my errorhandler, that would mess with the call stack. May returning an Error could be optional (null value) in which case the Try would just throw.
Beta Was this translation helpful? Give feedback.
All reactions