Please forgive me if this is documented somewhere or has been asked and answered before. I've been searching but haven't been able to find an answer.
How do I get django-like error handling with Pyramid, where I can debug exceptions with the pyramid debugtoolbar during development, and in production send an email and display a nice error message? I've got it mostly working. The problem is that I've defined an error handling view like so:
@view_config(context=Exception, renderer='templates/
500.pt')
def catch_500(request):
response = request.response
response.status_int = 500
return {}
And that works great with pyramid_exclog for sending the email. But when I try to run that in development with the pyramid_debugtoolbar included, the exception always gets handled by the view. The behaviour I'd like to see is for the debugtoolbar to catch the exception before it gets to the exception view. When I take out the view definition, the debugtoolbar _will_ catch it, so I know I've got the debugtoolbar included correctly. I'm sure this is not an unusual request, and I've got to be missing something obvious.
Thanks for your help.
-Brian