Files @ 2c0c3aec0d63
Branch filter:

Location: light9/lib/cycloneerr.py

drewp@bigasterisk.com
critical fix- put slash in the uri map prefix so it gets removed from uris, so filenames don't have // in them and fail to compare right to other versions
Ignore-this: 3098459d044bbd5ce92a0d5b7b428f27
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),
        }