Skip to content

Instantly share code, notes, and snippets.

@mactanxin
Created February 17, 2013 03:30
Show Gist options
  • Save mactanxin/4969964 to your computer and use it in GitHub Desktop.
Save mactanxin/4969964 to your computer and use it in GitHub Desktop.
test gist public sharing through sublime text2 addon
class RequestHandler(web.RequestHandler):
def __init__(self, application, request, status_code=None):
web.RequestHandler.__init__(self, application, request)
if status_code: self.set_status(status_code)
def get_error_html(self, status_code, **kwargs):
if status_code == 404:
return self.render_string('404.html')
elif status_code == 405:
return self.render_string('servererror.html')
elif status_code == 500:
return self.render_string('500.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment