Skip to content

Commit b26a92d

Browse files
committed
Add custom 500 error handler so app handler errors aren't supressed
1 parent e284c93 commit b26a92d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ def hello():
1717
def page_not_found(e):
1818
"""Return a custom 404 error."""
1919
return 'Sorry, Nothing at this URL.', 404
20+
21+
22+
@app.errorhandler(500)
23+
def page_not_found(e):
24+
"""Return a custom 500 error."""
25+
return 'Sorry, unexpected error: {}'.format(e), 500

0 commit comments

Comments
 (0)