Mercurial > code > home > repos > homeauto
view lib/cycloneerr/cycloneerr.py @ 1588:0757fafbfdab
WIP inferencer - partial var and function support
author | drewp@bigasterisk.com |
---|---|
date | Thu, 02 Sep 2021 01:58:31 -0700 |
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), }