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
If you want to catch all exceptions, run a cleanup action and rethrow, use one of the functions from the cleanup section.
While several of those functions let you specify a an action to be performed when an exception is thrown, they don't give you access to the actual exception. This problem is shared with the Control.Exception module in the base package, but the safe-exceptions package contains this useful function that otherwise behaves like onException:
withException :: Exception e => IO a -> (e -> IO b) -> IO a
It would be great if effectful could provide a similar function, since it's easy to get the edge cases wrong when dealing with asynchronous exceptions.
The text was updated successfully, but these errors were encountered:
The documentation says:
While several of those functions let you specify a an action to be performed when an exception is thrown, they don't give you access to the actual exception. This problem is shared with the Control.Exception module in the base package, but the safe-exceptions package contains this useful function that otherwise behaves like onException:
It would be great if effectful could provide a similar function, since it's easy to get the edge cases wrong when dealing with asynchronous exceptions.
The text was updated successfully, but these errors were encountered: