Mercurial > code > home > repos > light9
view lib/cycloneerr.py @ 1614:8753dd9e6bd1
add a bit of #ffffff to small rainbow
Ignore-this: d32db85f76e5bc74d29884e5c1890c98
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Wed, 07 Jun 2017 04:50:30 +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), }