From bcc7a3277259288ce1a2425de084e03a1673f1cb Mon Sep 17 00:00:00 2001 From: Christian Krakau-Louis Date: Fri, 11 Apr 2025 14:18:48 +0000 Subject: [PATCH] fix: Update template directory path for error handlers --- app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 5e4cbc85..b62eec76 100644 --- a/app/main.py +++ b/app/main.py @@ -92,7 +92,7 @@ async def shutdown_event(): @app.exception_handler(404) async def custom_404_handler(request: Request, exc: HTTPException): # Serve the 404 template directly - templates = Jinja2Templates(directory=str(frontend_static_dir.parent / "templates")) + templates = Jinja2Templates(directory=str(static_dir.parent / "templates")) return templates.TemplateResponse( "404.html", {"request": request}, @@ -101,7 +101,7 @@ async def custom_404_handler(request: Request, exc: HTTPException): @app.exception_handler(500) async def custom_500_handler(request: Request, exc: Exception): - templates = Jinja2Templates(directory=str(frontend_static_dir.parent / "templates")) + templates = Jinja2Templates(directory=str(static_dir.parent / "templates")) # Option 1: Keep it simple, just show a funny 500 message: return templates.TemplateResponse( "500.html",