-
Notifications
You must be signed in to change notification settings - Fork 107
Python: support logging ExceptionGroup sub-exceptions #1682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @io-canopy, thanks for raising this. With our current architecture, when an exception is raised, we catch it and propagate forward the exception name and exception content. The top level exception is Essentially, our structure looks like this:
Translated to the script, it would look similarly to this:
If my understanding is correct (and I could be wrong here), if the We can look into perhaps handling sync vs. async exceptions differently. While we cannot change the try-catch structure, we might be able to check for sub-exceptions and output those as well. In the meantime, to unblock your scenario, you can catch and handle all the sub-exceptions in your function code like so:
That will output something like this:
|
Description
Using the following code:
When run in the terminal,
./function_app.py
, I get:Which is quite helpful. Unfortunately, in
func host start --verbose
, I get the following traceback instead:Which isn't all that helpful. It would be nice if
func host
could log the inner exceptions in an ExceptionGroup so that using asyncio/anyio is a little friendlier.The text was updated successfully, but these errors were encountered: