Skip to content

Commit

Permalink
dbid check
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Aug 27, 2024
1 parent a37ffae commit 2cb9ee3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion impl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ async def dispatch(self, request: Request, call_next):
response = await call_next(request)
return response
except Exception as e:
logger.error(f"Error: {e}, dbid: {request.state.dbid}")
if hasattr(request.state, "dbid"):
logger.error(f"Error: {e}, dbid: {request.state.dbid}")
else:
logger.error(f"Error: {e}")
print(e)
raise e

Expand Down

0 comments on commit 2cb9ee3

Please sign in to comment.