Commit 6d54e97b authored by Hanno Schlichting's avatar Hanno Schlichting

Re-use `HTTPExcpeption.body_template` in httpexceptions middleware.

parent 665b64e3
...@@ -17,36 +17,6 @@ from zExceptions import ( ...@@ -17,36 +17,6 @@ from zExceptions import (
InternalError, InternalError,
) )
ERROR_HTML = """\
<!DOCTYPE html>
<html>
<head>
<title>Site Error</title>
<meta charset="utf-8" />
</head>
<body bgcolor="#FFFFFF">
<h2>Site Error</h2>
<p>An error was encountered while publishing this resource.
</p>
<p><strong>Sorry, a site error occurred.</strong></p>
%s
<hr noshade="noshade"/>
<p>Troubleshooting Suggestions</p>
<ul>
<li>The URL may be incorrect.</li>
<li>The parameters passed to this resource may be incorrect.</li>
<li>A resource that this resource relies on may be
encountering an error.</li>
</ul>
<p>If the error persists please contact the site maintainer.
Thank you for your patience.
</p>
</body></html>"""
class HTTPExceptionHandler(object): class HTTPExceptionHandler(object):
...@@ -64,7 +34,7 @@ class HTTPExceptionHandler(object): ...@@ -64,7 +34,7 @@ class HTTPExceptionHandler(object):
def catch_all_response(self, exc): def catch_all_response(self, exc):
response = InternalError() response = InternalError()
response.setBody(ERROR_HTML % repr(exc)) response.detail = repr(exc)
return response return response
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment