feat: themed 404 and 500 pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 14:57:45 -04:00
parent b6954bd9d2
commit b0d9e9b6ad
3 changed files with 30 additions and 1 deletions
+10 -1
View File
@@ -2,7 +2,7 @@
from __future__ import annotations
import asyncio
from pathlib import Path
from quart import Quart
from quart import Quart, render_template
from .config import load_bootstrap
from .database import init_db
@@ -161,6 +161,15 @@ def create_app(
async def health():
return {"status": "ok"}
# ── 12. Error handlers ─────────────────────────────────────────────────────
@app.errorhandler(404)
async def not_found(_):
return await render_template("errors/404.html"), 404
@app.errorhandler(500)
async def server_error(_):
return await render_template("errors/500.html"), 500
# ── 11. Startup hook ───────────────────────────────────────────────────────
@app.before_serving
async def startup():