elli
elli copied to clipboard
Middleware to show better 4xx, 5xx responses
I'm a bit reluctant to a catch-all in the middleware, as this makes it tricky to call the handle_event/3 callbacks for request_{exception,error,exit}. An option would be to call it from the middleware explicitly.
I will have to think about it for a bit.. :-)
While you were thinking I've tried to solve the problem in the easiest way :grin:
Notes:
- this pull request solves the problem of missing
postprocesscall for error requests (was it a problem to solve?) - the way I've tested
handle_event/3callback is primitive, I'd really like to see how you would achieve this task - this solution highlights problems of handling middlewares with a plain elli handler, it's elegant, but there should be a better way to do it