
15 Dec
2011
15 Dec
'11
5:22 p.m.
I has problem with error catching in WAI+Warp. Because, as I understand it, all response lives in Iteratee monad. And ofcourse all code is lazy. I found this gist: https://gist.github.com/1267589 - it helps to catch non-lazy errors (I just make WAI middleware). But if error occurs in lazy code:
responseLBS status200 [] undefined
... all dies. All errors goes to line 14 and Warp sends "200/OK" with empty response instead, for example '500/Internal Server Error'. How could handle all the errors?