aurweb/aurweb/routers/errors.py
2021-06-05 19:52:56 -07:00

14 lines
363 B
Python

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,
}