Hi,

I'm writing a Pylons 1.0 app that returns json rather than HTML. I
want to write an Uncaught Exception Handler so that no matter what
happens I can return a correctly formatted response.

I've looked into the ErrorMiddleware but as far as I can tell it is
for catching HTTP errors rather than general exceptions.

I thought about adding a decorator to each controller method but this
seems like overkill

I tried adding a exception handler in the __call__ of the
BaseController but while it catches the exception I only see an
'Internal server error' in the output.

What is the correct way to catch all exceptions and then return a
response that has the correct headers (application/json) and body?

Thanks,

BEN

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to