# HG changeset patch # User Martin Bornhold # Date 2016-10-06 13:39:03 # Node ID cc8792380b0a94526c85b8543868546b4aca7a5c # Parent c9704d4f1feb7c7adf92cd3aad3ea40e5c7b8b44 wsgi-stack: Add a more meaningful comment why we insert the error middleware. diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -192,8 +192,11 @@ def make_not_found_view(config): pylons_app = VCSMiddleware( pylons_app, settings, appenlight_client, registry=config.registry) - # Add an error handling middleware to convert errors from the old pylons - # app into a proper error page response. + # The pylons app is executed inside of the pyramid 404 exception handler. + # Exceptions which are raised inside of it are not handled by pyramid + # again. Therefore we add a middleware that invokes the error handler in + # case of an exception or error response. This way we return proper error + # HTML pages in case of an error. reraise = (settings.get('debugtoolbar.enabled', False) or rhodecode.disable_error_handler) pylons_app = PylonsErrorHandlingMiddleware(