Mercurial > code > home > repos > light9
view lib/cycloneerr.py @ 1445:6001c86f9fca
timeline: 1 row for now since i think the others were duplicating all notes (and also not showing them)
Ignore-this: a763f8f93b04f6473600944e9533437d
author | drewp@bigasterisk.com |
---|---|
date | Sat, 11 Jun 2016 21:16:06 +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), }