Commit 50c9d21
authored
Adjust
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 #59209print_response to separate error-printing from result display, remove loop (#59218)1 parent 920df7a commit 50c9d21
1 file changed
+47
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
582 | 586 | | |
583 | 587 | | |
584 | 588 | | |
| |||
593 | 597 | | |
594 | 598 | | |
595 | 599 | | |
596 | | - | |
| 600 | + | |
| 601 | + | |
597 | 602 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
614 | 609 | | |
615 | | - | |
616 | | - | |
617 | | - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
618 | 613 | | |
619 | 614 | | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 615 | + | |
| 616 | + | |
633 | 617 | | |
634 | | - | |
635 | | - | |
| 618 | + | |
| 619 | + | |
636 | 620 | | |
637 | | - | |
638 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
639 | 625 | | |
640 | 626 | | |
641 | 627 | | |
642 | 628 | | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
643 | 653 | | |
644 | 654 | | |
645 | 655 | | |
| |||
0 commit comments