You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjust print_response to separate error-printing from result display, remove loop (#59218)
Took a stab at fixing #59209 , but it could be introducing other ways it
could fail that I'm not appreciating?
1.11.4 logic:
1. If it's an error, print the error then break and return
2. If it's an error, and printing the error causes an error, catch it,
try two levels of fallback printing, then break and return
3. If it's okay, display the result then break and return
4. If it's okay, and displaying the result causes an error, print a
message, rethrow, catch, populate the response variables with the new
exception info, and start the loop over to follow the error printing
pathway for those values
In no case does the loop execute more than twice.
In 1.11.5+, condition 4 ends up following path 2, and path 4 would only
be followed if there's an exception in the scaffolding around the
`display` invocations.
I restructured it to take out the loop, now it just attempts display if
there was no error, accounts for errors during display, and then errors
from either response or display are printed.
I'm not sure if I used the `sigatomic_end` calls correctly. **EDIT: See
comment below**
Also tweaked the final fallback message because it suggests the issue is
that the exception per se is a nested type, rather than that printing
one exception is triggering another exception. And added a condition to
trim REPL frames when it originates from within `print_response`.
Fixes#59209
0 commit comments