Mercurial > code > home > repos > homeauto
view lib/cycloneerr/cycloneerr.py @ 1416:201090b9c725
just reindent, i think
Ignore-this: 519383817f24612419191d79e14bfb5c
darcs-hash:9573fbb16b44da29f3d4f3b1c429595a13e51532
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 03 Aug 2019 17:02:16 -0700 |
parents | c5bd44f90ced |
children | fd94061db75c |
line wrap: on
line source
try: import http.client as httplib except ImportError: import httplib # type: ignore import 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), }