Mercurial > code > home > repos > light9
view lib/cycloneerr.py @ 1454:50fe80faebab
animRainbow test. KC faster frame rate
Ignore-this: 419c6a70711ba3df9a234998760f8d9c
author | drewp@bigasterisk.com |
---|---|
date | Sun, 12 Jun 2016 00:26:12 +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), }