Skip to content

Commit 1f4e0db

Browse files
authored
Fix bug in exception handling
1 parent a3b8205 commit 1f4e0db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ async def db_middleware(request: Request, call_next) -> None:
3939
request.state.audit_logger.save_audits(db_session)
4040
db_session.commit()
4141
except TimeoutError:
42-
return TextResponse(503, "Timeout when connecting to database")
42+
return PlainTextResponse(503, "Timeout when connecting to database")
4343
except DatabaseError:
44-
return TextResponse(500, "Error when connecting to database")
44+
return PlainTextResponse(500, "Error when connecting to database")
4545

4646
return response
4747

0 commit comments

Comments
 (0)