Relax error and send error_code to template
This commit is contained in:
parent
6740afd6a0
commit
cc8f30eba2
@ -115,7 +115,18 @@ def error_page(e):
|
|||||||
error_message=exc_info()[1].error_message,
|
error_message=exc_info()[1].error_message,
|
||||||
slim=slim
|
slim=slim
|
||||||
), 502)
|
), 502)
|
||||||
return flask.render_template('error.html', traceback=traceback.format_exc(), slim=slim), 500
|
elif (exc_info()[0] == util.FetchError
|
||||||
|
and exc_info()[1].code == '404'
|
||||||
|
):
|
||||||
|
error_message = ('Error: The page you are looking for isn\'t here. ¯\_(ツ)_/¯')
|
||||||
|
return flask.render_template('error.html',
|
||||||
|
error_code=exc_info()[1].code,
|
||||||
|
error_message=error_message,
|
||||||
|
slim=slim), 404
|
||||||
|
return flask.render_template('error.html', traceback=traceback.format_exc(),
|
||||||
|
error_code=exc_info()[1].code,
|
||||||
|
slim=slim), 500
|
||||||
|
# return flask.render_template('error.html', traceback=traceback.format_exc(), slim=slim), 500
|
||||||
|
|
||||||
|
|
||||||
font_choices = {
|
font_choices = {
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{% set page_title = 'Error' %}
|
{% if error_code %}
|
||||||
|
{% set page_title = 'Error: ' ~ error_code %}
|
||||||
|
{% else %}
|
||||||
|
{% set page_title = 'Error' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if not slim %}
|
{% if not slim %}
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user