##// END OF EJS Templates
errorpages: use original http status for rendered error page
dan -
r190:299c0020 default
parent child Browse files
Show More
@@ -31,9 +31,9 b' from pyramid.config import Configurator'
31 31 from pyramid.static import static_view
32 32 from pyramid.settings import asbool, aslist
33 33 from pyramid.wsgi import wsgiapp
34 from pyramid.httpexceptions import HTTPError
34 from pyramid.httpexceptions import HTTPError, HTTPInternalServerError
35 35 import pyramid.httpexceptions as httpexceptions
36 from pyramid.renderers import render_to_response
36 from pyramid.renderers import render_to_response, render
37 37 from routes.middleware import RoutesMiddleware
38 38 import routes.util
39 39
@@ -183,8 +183,15 b' def error_handler(exc, request):'
183 183 if not c.rhodecode_name:
184 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 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 195 return response
189 196
190 197
General Comments 0
You need to be logged in to leave comments. Login now