Server event handlers failing silently without logging exceptions #1234
Unanswered
justinhaaheim
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I've added a division by zero in one of the ASGI examples to try to reproduce this. Python itself logs the exception when the task running the handler ends. I can agree that this can be done better, I could catch the exception and log it on the configured logger, for example, but in any case the exception does appear to be reported.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a socketio Async server setup with logging enabled, and I realized yesterday that when an exception is raised inside an event handler the handler fails silently and nothing is logged. This makes debugging very difficult!
Is there a way to change this behavior? Or am I missing something about how exceptions should be handled? It seems strange to wrap the contents of all my event handlers in big try/except blocks , but I suppose I could do that.
My server is configured like this:
And I'm running it with uvicorn:
uvicorn --reload app_pubsub:app
Beta Was this translation helpful? Give feedback.
All reactions