mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
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:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user