Mercurial > code > home > repos > homeauto
view lib/cycloneerr.py @ 502:cf3fca0b4512
rm old complicated usb bus checker and resetter that caught some error modes and reset the right parts of the usb tree
Ignore-this: 1003481c29f8bb01b3758bf6f6241d65
author | drewp@bigasterisk.com |
---|---|
date | Sun, 21 Apr 2019 03:04:42 -0700 |
parents | a63549a50b3f |
children |
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), }