##// END OF EJS Templates
error-handling: Remove if condition to check if the response is a vcs response....
Martin Bornhold -
r949:706ee3c3 default
parent child Browse files
Show More
@@ -51,17 +51,10 b' class PylonsErrorHandlingMiddleware(obje'
51 51 response = self.handle_request(request)
52 52 return response(environ, start_response)
53 53
54 def is_vcs_response(self, response):
55 return 'X-RhodeCode-Backend' in response.headers
56
57 54 def is_http_error(self, response):
58 55 # webob type error responses
59 56 return (400 <= response.status_int <= 599)
60 57
61 def is_error_handling_needed(self, response):
62 return (self.is_http_error(response) and not
63 self.is_vcs_response(response))
64
65 58 def reraise(self):
66 59 return self._reraise
67 60
@@ -77,7 +70,7 b' class PylonsErrorHandlingMiddleware(obje'
77 70 """
78 71 try:
79 72 response = request.get_response(self.app)
80 if self.is_error_handling_needed(response):
73 if self.is_http_error(response):
81 74 response = webob_to_pyramid_http_response(response)
82 75 return self.error_view(response, request)
83 76 except HTTPError as e: # pyramid type exceptions
General Comments 0
You need to be logged in to leave comments. Login now