Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

Commit

Permalink
Add custom 500 error handler so app handler errors aren't supressed
Browse files Browse the repository at this point in the history
  • Loading branch information
fredsa committed Mar 4, 2014
1 parent e284c93 commit b26a92d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ def hello():
def page_not_found(e):
"""Return a custom 404 error."""
return 'Sorry, Nothing at this URL.', 404


@app.errorhandler(500)
def page_not_found(e):
"""Return a custom 500 error."""
return 'Sorry, unexpected error: {}'.format(e), 500

0 comments on commit b26a92d

Please sign in to comment.