Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Joakim Saario
aurweb
Commits
cdf75ced
Commit
cdf75ced
authored
May 13, 2021
by
Marcus Andersson
Committed by
Kevin Morris
Jun 05, 2021
Browse files
Adding error 404 catcher
parent
82f3871a
Changes
2
Hide whitespace changes
Inline
Side-by-side
aurweb/routers/errors.py
0 → 100644
View file @
cdf75ced
from
aurweb.templates
import
make_context
,
render_template
from
aurweb
import
l10n
async
def
not_found
(
request
,
exc
):
_
=
l10n
.
get_translator_for_request
(
request
)
context
=
make_context
(
request
,
f
"404 -
{
_
(
'Page Not Found'
)
}
"
)
return
render_template
(
"errors/404.html"
,
context
)
# Maps HTTP errors to functions
exceptions
=
{
404
:
not_found
,
}
templates/errors/404.html
0 → 100644
View file @
cdf75ced
{% extends 'partials/layout.html' %}
{% block pageContent %}
<div
class=
"box 404"
>
<h2>
404 - {% trans %}Page Not Found{% endtrans %}
</h2>
<p>
{% trans %}Sorry, the page you've requested does not exist.{% endtrans %}
</p>
</div>
{% endblock %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment