Fix missing books in sidebar on 404 page

Add books list to error handler template context so the sidebar
navigation displays Bible books on error pages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-24 10:54:28 -05:00
parent 324143e566
commit df28d46abd
+2
View File
@@ -615,12 +615,14 @@ async def startup_event():
async def custom_http_exception_handler(request: Request, exc: StarletteHTTPException):
"""Custom error handler that renders our error template"""
if exc.status_code == 404:
books = list(bible.iter_books())
return templates.TemplateResponse(
"error.html",
{
"request": request,
"status_code": exc.status_code,
"detail": exc.detail,
"books": books,
},
status_code=exc.status_code,
)