Mercurial > code > home > repos > homeauto
view lib/cycloneerr.py @ 310:6ba2c88f9847
beaconmap rewrites with influxdb
Ignore-this: 8f5e74d944a1abda0c758ea6e65df2f0
author | drewp@bigasterisk.com |
---|---|
date | Fri, 16 Sep 2016 01:27:28 -0700 |
parents | be855a111619 |
children | 053fd552b675 |
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), }