Created
December 17, 2009 23:01
-
-
Save nuance/259114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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