From 1a3f93ca85ca6ca759fcb4dc831dcc74b76a731f Mon Sep 17 00:00:00 2001 From: Martin Bornhold Date: Thu, 6 Oct 2016 16:08:34 +0200 Subject: [PATCH] error-handling: Remove if condition to check if the response is a vcs response. We moved the VCS middleware out of the error handling. Therefore we don't need to skip the error handling anymore. --- rhodecode/lib/middleware/error_handling.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rhodecode/lib/middleware/error_handling.py b/rhodecode/lib/middleware/error_handling.py index 71f33973..113c1fd3 100644 --- a/rhodecode/lib/middleware/error_handling.py +++ b/rhodecode/lib/middleware/error_handling.py @@ -51,17 +51,10 @@ class PylonsErrorHandlingMiddleware(object): response = self.handle_request(request) return response(environ, start_response) - def is_vcs_response(self, response): - return 'X-RhodeCode-Backend' in response.headers - def is_http_error(self, response): # webob type error responses return (400 <= response.status_int <= 599) - def is_error_handling_needed(self, response): - return (self.is_http_error(response) and not - self.is_vcs_response(response)) - def reraise(self): return self._reraise @@ -77,7 +70,7 @@ class PylonsErrorHandlingMiddleware(object): """ try: response = request.get_response(self.app) - if self.is_error_handling_needed(response): + if self.is_http_error(response): response = webob_to_pyramid_http_response(response) return self.error_view(response, request) except HTTPError as e: # pyramid type exceptions