This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Zac Hatfield-Dodds
Recipients Zac Hatfield-Dodds, aroberge, gvanrossum, iritkatriel
Date 2021-10-26.00:48:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635209318.94.0.913884114798.issue45607@roundup.psfhosted.org>
In-reply-to
Content
This code shows my current best workaround based on a wrapper exception, with the traceback below annotating the additional details that I'd prefer to omit for clarity:


$ python example.py
Traceback (most recent call last):
  File "example.py", line 8, in <module>
    raise AssertionError(why)
AssertionError: Failed!
                                                                        # These lines are
The above exception was the direct cause of the following exception:    # confusing for new 
                                                                        # users, and they
Traceback (most recent call last):                                      # only exist due 
  File "example.py", line 10, in <module>                               # to implementation
    raise Explanation(msg) from e                                       # via the Explanation
Explanation:                                                            # wrapper type :-(
    You can reproduce this error by ...
    ...


The motivation for this is that we'd like to use ExceptionGroup to indicate that `MultipleFailures` is a group of exceptions, and replace our current print()-based method of reporting the details of the inner exceptions.
History
Date User Action Args
2021-10-26 00:48:39Zac Hatfield-Doddssetrecipients: + Zac Hatfield-Dodds, gvanrossum, aroberge, iritkatriel
2021-10-26 00:48:38Zac Hatfield-Doddssetmessageid: <1635209318.94.0.913884114798.issue45607@roundup.psfhosted.org>
2021-10-26 00:48:38Zac Hatfield-Doddslinkissue45607 messages
2021-10-26 00:48:38Zac Hatfield-Doddscreate