Skip to content

Commit

Permalink
Added 500 error page through GAE
Browse files Browse the repository at this point in the history
  • Loading branch information
jpr71 committed Feb 26, 2016
1 parent aa4146c commit 6becd1b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import logging

import webapp2

def handle_404(request, response, exception):
logging.exception(exception)
response.write('Oops! I could swear this page was here!')
response.set_status(404)

def handle_500(request, response, exception):
logging.exception(exception)
response.write('A server error occurred!')
response.set_status(500)

app = webapp2.WSGIApplication([
webapp2.Route(r'/', handler='handlers.HomeHandler', name='home')
])
app.error_handlers[404] = handle_404
app.error_handlers[500] = handle_500
1 change: 1 addition & 0 deletions strains
Submodule strains added at 9a211a

0 comments on commit 6becd1b

Please sign in to comment.