Mercurial > code > home > repos > light9
view lib/cycloneerr.py @ 1164:65f0179a9254
subcomposer has a web ui with buttons for toggling lights
Ignore-this: f8cf76c46d81eec86c8945a61f6a594d
author | drewp@bigasterisk.com |
---|---|
date | Sun, 15 Jun 2014 02:23:39 +0000 |
parents | 473db8bebb8f |
children |
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), }