|
|
|
@ -48,7 +48,9 @@ def register_blueprints(app): |
|
|
|
|
|
|
|
|
|
def register_errorhandlers(app): |
|
|
|
|
def render_error(error): |
|
|
|
|
return render_template("{0}.html".format(error.code)), error.code |
|
|
|
|
# If a HTTPException, pull the `code` attribute; default to 500 |
|
|
|
|
error_code = getattr(error, 'code', 500) |
|
|
|
|
return render_template("{0}.html".format(error_code)), error_code |
|
|
|
|
for errcode in [401, 404, 500]: |
|
|
|
|
app.errorhandler(errcode)(render_error) |
|
|
|
|
return None |
|
|
|
|