Skip to content

Instantly share code, notes, and snippets.

@nuance
Created December 17, 2009 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nuance/259114 to your computer and use it in GitHub Desktop.
Save nuance/259114 to your computer and use it in GitHub Desktop.
import httplib
import web
urls = ("/(.+)", "http_err")
app = web.application(urls, globals())
class http_err:
def GET(self, err_code):
err_code = int(err_code)
response = "%d %s" % (err_code, httplib.responses[err_code])
raise web.HTTPError(response)
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment