-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
except_star.md
Outdated
|
||
# would result in: | ||
# | ||
# ExceptionGroup( | ||
# ExceptionGroup( | ||
# "????", <-- TODO: what is the message of this EG? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the empty string. Then I believe it will be rendered as
ExceptionGroup
instead of
ExceptionGroup: some message
…eption groups with their metadata preserved
except_star.md
Outdated
@@ -199,14 +204,14 @@ except *OSerror as errors: | |||
for e in errors: | |||
if e.errno != errno.EPIPE: | |||
new_errors.append(e) | |||
raise ExceptionGroup(*new_errors) | |||
raise ExceptionGroup(e.msg, *new_errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
‘e.msg’ seems wrong here, e is a leftover from the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, should be errors.msg.
I'm not sure if the So perhaps it should be |
We should do whatever is the most convenient for the caller. The type can be dealt with later (and But it looks like the most common use case is probably when we have naturally collected the sub-exceptions in a list already, since we catch them one at a time. So then your proposal of using a single list (sequence) argument makes sense. |
No description provided.