Show More
@@ -31,9 +31,9 b' from pyramid.config import Configurator' | |||||
31 | from pyramid.static import static_view |
|
31 | from pyramid.static import static_view | |
32 | from pyramid.settings import asbool, aslist |
|
32 | from pyramid.settings import asbool, aslist | |
33 | from pyramid.wsgi import wsgiapp |
|
33 | from pyramid.wsgi import wsgiapp | |
34 | from pyramid.httpexceptions import HTTPError |
|
34 | from pyramid.httpexceptions import HTTPError, HTTPInternalServerError | |
35 | import pyramid.httpexceptions as httpexceptions |
|
35 | import pyramid.httpexceptions as httpexceptions | |
36 | from pyramid.renderers import render_to_response |
|
36 | from pyramid.renderers import render_to_response, render | |
37 | from routes.middleware import RoutesMiddleware |
|
37 | from routes.middleware import RoutesMiddleware | |
38 | import routes.util |
|
38 | import routes.util | |
39 |
|
39 | |||
@@ -183,8 +183,15 b' def error_handler(exc, request):' | |||||
183 | if not c.rhodecode_name: |
|
183 | if not c.rhodecode_name: | |
184 | c.rhodecode_name = 'Rhodecode' |
|
184 | c.rhodecode_name = 'Rhodecode' | |
185 |
|
185 | |||
|
186 | base_response = HTTPInternalServerError() | |||
|
187 | # prefer original exception for the response since it may have headers set | |||
|
188 | if isinstance(exc, HTTPError): | |||
|
189 | base_response = exc | |||
|
190 | ||||
186 | response = render_to_response( |
|
191 | response = render_to_response( | |
187 |
'/errors/error_document.html', {'c': c}, request=request |
|
192 | '/errors/error_document.html', {'c': c}, request=request, | |
|
193 | response=base_response) | |||
|
194 | ||||
188 | return response |
|
195 | return response | |
189 |
|
196 | |||
190 |
|
197 |
General Comments 0
You need to be logged in to leave comments.
Login now