Remove extra kwargs and put the text in the template since all error pages will show the same text in MVP
This commit is contained in:
parent
b990a59dc9
commit
7db38ede59
@ -26,25 +26,10 @@ def notify(e, message, code):
|
|||||||
current_app.notification_sender.send(message)
|
current_app.notification_sender.send(message)
|
||||||
|
|
||||||
|
|
||||||
def handle_error(
|
def handle_error(e, message=translate("errors.not_found"), code=404):
|
||||||
e,
|
|
||||||
message=translate("errors.not_found"),
|
|
||||||
code=404,
|
|
||||||
submessage=translate("errors.not_found_sub"),
|
|
||||||
more_info=translate("common.lorem"),
|
|
||||||
):
|
|
||||||
log_error(e)
|
log_error(e)
|
||||||
notify(e, message, code)
|
notify(e, message, code)
|
||||||
return (
|
return (render_template("error.html", message=message, code=code), code)
|
||||||
render_template(
|
|
||||||
"error.html",
|
|
||||||
message=message,
|
|
||||||
code=code,
|
|
||||||
submessage=submessage,
|
|
||||||
more_info=more_info,
|
|
||||||
),
|
|
||||||
code,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def make_error_pages(app):
|
def make_error_pages(app):
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
{{ Icon('cloud', classes="icon--red icon--large")}}
|
{{ Icon('cloud', classes="icon--red icon--large")}}
|
||||||
<hr>
|
<hr>
|
||||||
<h1>{{ code }} - {{ message }}</h1>
|
<h1>{{ code }} - {{ message }}</h1>
|
||||||
<p>{{ submessage }}</p>
|
<p>{{ "errors.not_found_sub" | translate }}</p>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="panel__body">
|
<div class="panel__body">
|
||||||
<p>
|
<p>
|
||||||
{{ more_info }}
|
{{ "common.lorem" | translate }}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="#">More lorem</a>
|
<a href="#">More lorem</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user