Mercurial > code > home > repos > homeauto
view lib/cycloneerr.py @ 412:91162a54553c
copy rest of rfid service from the first try. fix some crashes in tags.py
Ignore-this: a3fdcc0a8494e358d3c0abc109e8ed4d
author | drewp@bigasterisk.com |
---|---|
date | Sat, 23 Mar 2019 04:26:03 -0700 |
parents | be855a111619 |
children | 053fd552b675 |
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), }