errorpages: convert general exceptions to error page if toolbar disabled

This commit is contained in:
Daniel Dourvaris 2016-06-14 12:02:49 +03:00
parent ad8747e7bf
commit cb75973073

View file

@ -261,7 +261,10 @@ def includeme(config):
webob_to_pyramid_http_response(response), request)
except HTTPError as e: # pyramid type exceptions
return error_handler(e, request)
except Exception:
if settings.get('debugtoolbar.enabled', False):
raise
return error_handler(HTTPInternalServerError(), request)
return response
# This is the glue which allows us to migrate in chunks. By registering the