errorhandlers for 5xx give exception, not code
This commit is contained in:
parent
b6d0efebbc
commit
82487c97b1
1 changed files with 5 additions and 1 deletions
6
app.py
6
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')
|
||||
|
|
Reference in a new issue