[Haskell-cafe] Absolutely confused with error/exception handling

Saurabh Nanda saurabhnanda at gmail.com
Sun Dec 18 03:45:32 UTC 2016


My recommendation is to catch the exception in IO first, before it is
lifted into the ActionCtxT. If your business logic is decoupled from
the web framework (as it should be) then it should be easy enough to
do this.


I'm trying to write a "global" error handler which logs unhandled errors to
Airbrake along with information from the request object (domain, URL,
params, cookies, etc). I understand that I can make this part of my app
monad, but if I don't understand why I'm unable to catch errors in MonadIO
I'm bound to get stuck again, or implement it incorrectly (for example,
what are the resource leaks that were being referred to?)

Also what if a particular handler is not in my app monad? How do I prevent
someone from accidentally adding a handler without the airbrake integration?

-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20161218/c3d325b8/attachment.html>


More information about the Haskell-Cafe mailing list