errorhandlers for 5xx give exception, not code

This commit is contained in:
Rupus Reinefjord 2018-01-16 09:36:05 +01:00
parent b6d0efebbc
commit 82487c97b1

6
app.py
View file

@ -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')