Skip to content

Commit

Permalink
log internal error
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 19, 2024
1 parent 572204e commit 4e0eac3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def plain_text_exception_handler(_: Request, exc: Exception) -> Template:
status_code = getattr(exc, "status_code", HTTP_500_INTERNAL_SERVER_ERROR)
detail = getattr(exc, "detail", "")

if not isinstance(exc, HTTPException):
logger.error("internal server error: {}", exc)

return Template(
"error.html.jinja2",
status_code=status_code,
Expand Down

0 comments on commit 4e0eac3

Please sign in to comment.