Mercurial > code > home > repos > homeauto
view lib/cycloneerr/cycloneerr.py @ 1712:6ee9a1c5a991
update deps; code fixes; add skaffold
author | drewp@bigasterisk.com |
---|---|
date | Sun, 12 Dec 2021 22:03:28 -0800 |
parents | 71e8ab109f5a |
children |
line wrap: on
line source
try: import http.client as httplib except ImportError: import httplib # type: ignore import html 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" : html.escape(tb), }