Closed ugtar closed 11 months ago
Ah dang. Agreed, it should at least fall back to default output, if not fully supporting exception groups
I thought to work around this by setting add_summary=True
always, but it looks like the summary traceback is not the builtin traceback format, but a similar one, and in the case of ExceptionGroups it's still no good
>>> fn()
File "<stdin>", line 1, in <module>
File "<stdin>", line 7, in fn
---- (full traceback above) ----
File "<stdin>", line 1, in <module>
File "<stdin>", line 7, in fn
ExceptionGroup: multiple exceptions (2 sub-exceptions)
:man_shrugging:
maybe the summary could be made to use the default formatter?
Also, fwiw, falling back to the native exception formatter is what ipython is currently doing for exception groups https://github.com/ipython/ipython/pull/14108/
Fixed in the latest 0.2.11 on pypi! Thanks for the report
Only the outer-most exception seems be be visible in the output for a handled ExceptionGroup. here is a contrived example:
the normal output shows the sub-exceptions:
but with stackprinter
all we see is there are sub-exceptions.
I don't have any great suggestions, but maybe at least stackprinter could fall back to the basic output in the case of an ExceptionGroup