From cb75973073457a0e8940a19f3b169ed822c27d42 Mon Sep 17 00:00:00 2001 From: Daniel Dourvaris Date: Tue, 14 Jun 2016 12:02:49 +0300 Subject: [PATCH] errorpages: convert general exceptions to error page if toolbar disabled --- rhodecode/config/middleware.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py index 52005975..a375c669 100644 --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -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