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.
<div><br></div><div>I found this gist: <a href="https://gist.github.com/1267589">https://gist.github.com/1267589</a> - it helps to catch non-lazy errors (I just make WAI middleware). But if error occurs in lazy code:</div>
<div><br></div><div>> responseLBS status200 [] undefined</div><div><br></div><div>... all dies. All errors goes to line 14 and Warp sends "200/OK" with empty response instead, for example '500/Internal Server Error'. </div>
<div><br></div><div>How could handle all the errors?</div>