# HG changeset patch # User Daniel Dourvaris # Date 2016-07-14 10:04:08 # Node ID e17b1d9dbfe61f94c58b39a36964aff23d2a1298 # Parent b686b00907d10d4f43e70dd0caca59311cf9a95a errorpages: fix case when a pyramid httperror was not being rendered with error handler diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -277,13 +277,11 @@ def includeme(config): # how to handle a request. config.add_notfound_view(pylons_app_with_error_handler) - if settings.get('debugtoolbar.enabled', False): - # if toolbar, then only http type exceptions get caught and rendered - ExcClass = HTTPError - else: + if not settings.get('debugtoolbar.enabled', False): # if no toolbar, then any exception gets caught and rendered - ExcClass = Exception - config.add_view(error_handler, context=ExcClass) + config.add_view(error_handler, context=Exception) + + config.add_view(error_handler, context=HTTPError) def includeme_last(config):