<div dir="auto"><div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My recommendation is to catch the exception in IO first, before it is<br>
lifted into the ActionCtxT. If your business logic is decoupled from<br>
the web framework (as it should be) then it should be easy enough to<br>
do this.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">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?)</div><div dir="auto"><br></div><div dir="auto">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?</div><div dir="auto"><br></div><div dir="auto">-- Saurabh. </div><div dir="auto"><div class="gmail_extra"><br></div></div></div>