Mercurial > code > home > repos > light9
view lib/cycloneerr.py @ 1763:9060602f7b3c
try to fix canvas issue, but it seems like just a bug in chrome 61
Ignore-this: 79447f827c6d630841dcea30152ab7d
author | drewp@bigasterisk.com |
---|---|
date | Thu, 31 May 2018 08:16:20 +0000 |
parents | 473db8bebb8f |
children |
line wrap: on
line source
import httplib, cgi class PrettyErrorHandler(object): """ mix-in to improve cyclone.web.RequestHandler """ def get_error_html(self, status_code, **kwargs): try: tb = kwargs['exception'].getTraceback() except AttributeError: tb = "" return "<html><title>%(code)d: %(message)s</title>" \ "<body>%(code)d: %(message)s<pre>%(tb)s</pre></body></html>" % { "code": status_code, "message": httplib.responses[status_code], "tb" : cgi.escape(tb), }