From 82487c97b1299c0cfb8077c5e13baa990e2a544e Mon Sep 17 00:00:00 2001 From: Rupus Reinefjord Date: Tue, 16 Jan 2018 09:36:05 +0100 Subject: [PATCH] errorhandlers for 5xx give exception, not code --- app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 9ed66e8..7720b3d 100644 --- a/app.py +++ b/app.py @@ -130,11 +130,15 @@ def is_safe_url(target): @app.errorhandler(404) -@app.errorhandler(500) def not_found(e): return flask.render_template('error/{}.html'.format(e.code)), e.code +@app.errorhandler(500) +def server_error(exc): + return flask.render_template('error/500.html'), 500 + + @app.route('/') def index(): return flask.render_template('index.html')