##// END OF EJS Templates
wsgi-stack: Move the vcs middleware out of the error handling....
Martin Bornhold -
r948:8c23f9c3 default
parent child Browse files
Show More
@@ -186,12 +186,6 b' def make_not_found_view(config):'
186 pylons_app, appenlight_client = wrap_in_appenlight_if_enabled(
186 pylons_app, appenlight_client = wrap_in_appenlight_if_enabled(
187 pylons_app, settings)
187 pylons_app, settings)
188
188
189 # The VCSMiddleware shall operate like a fallback if pyramid doesn't find
190 # a view to handle the request. Therefore we wrap it around the pylons app.
191 if vcs_server_enabled:
192 pylons_app = VCSMiddleware(
193 pylons_app, settings, appenlight_client, registry=config.registry)
194
195 # The pylons app is executed inside of the pyramid 404 exception handler.
189 # The pylons app is executed inside of the pyramid 404 exception handler.
196 # Exceptions which are raised inside of it are not handled by pyramid
190 # Exceptions which are raised inside of it are not handled by pyramid
197 # again. Therefore we add a middleware that invokes the error handler in
191 # again. Therefore we add a middleware that invokes the error handler in
@@ -202,6 +196,15 b' def make_not_found_view(config):'
202 pylons_app = PylonsErrorHandlingMiddleware(
196 pylons_app = PylonsErrorHandlingMiddleware(
203 pylons_app, error_handler, reraise)
197 pylons_app, error_handler, reraise)
204
198
199 # The VCSMiddleware shall operate like a fallback if pyramid doesn't find a
200 # view to handle the request. Therefore it is wrapped around the pylons
201 # app. It has to be outside of the error handling otherwise error responses
202 # from the vcsserver are converted to HTML error pages. This confuses the
203 # command line tools and the user won't get a meaningful error message.
204 if vcs_server_enabled:
205 pylons_app = VCSMiddleware(
206 pylons_app, settings, appenlight_client, registry=config.registry)
207
205 # Convert WSGI app to pyramid view and return it.
208 # Convert WSGI app to pyramid view and return it.
206 return wsgiapp(pylons_app)
209 return wsgiapp(pylons_app)
207
210
General Comments 0
You need to be logged in to leave comments. Login now