Skip to content

Backport "Make error reporting resilient to exception thrown while reporting" to LTS #21059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

WojciechMazur
Copy link
Contributor

Backports #20158 to the LTS branch.

PR submitted by the release tooling.
[skip ci]

smarter and others added 3 commits July 5, 2024 18:25
Previously the added test failed with `1 error reported` but no actual error
message printed, because a stack overflow is thrown while reporting the
original error. This is then caught and handled to emit a RecursionOverflow
error, but that second error is non-sensical and non-sensical errors are only
printed if `hasErrors` returns false.

We fix this by deferring incrementing the error count (and therefore having
`hasErrors` return true) until after having displayed the error. We also defer
calling `markReported` otherwise the second error will also be suppressed. A
similar change is necessary in our testing infrastructure to keep the error
count is coherent.

[Cherry-picked cd313fb]
Base automatically changed from lts-20043 to lts-3.3 July 5, 2024 21:32
@WojciechMazur
Copy link
Contributor Author

No regressions detected in the community build up to lts-20227.

Reference

@WojciechMazur WojciechMazur merged commit 52d6c1b into lts-3.3 Jul 5, 2024
19 checks passed
@WojciechMazur WojciechMazur deleted the lts-20158 branch July 5, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants