Repository navigation
fix: Rethrow fatal errors at the SDK's boundary catches (JAVA-552) - #6665
Open
runningcode wants to merge 7 commits into
Open
runningcode wants to merge 7 commits into
runningcode wants to merge 7 commits into
Conversation
The broad catches at boundaries, where we can't know what the other side throws, also swallowed OutOfMemoryError, StackOverflowError and LinkageError. They now call ExceptionUtils.rethrowIfFatal first, with a comment saying why the catch is broad and what is lost when it fails. The Javadoc of the user-facing callbacks says what happens when they throw. Sites where a LinkageError is the expected failure are left alone, so a missing or mismatched optional dependency keeps the old handling. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
This was referenced Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 18, 2026
Closed
📲 Install BuildsAndroid
|
Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
added a commit
that referenced
this pull request
Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
added a commit
that referenced
this pull request
Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
added a commit
that referenced
this pull request
Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Narrowing attachReportToEnvelope to IOException is a narrowing, not a boundary, so it moves to the PR that narrows catches. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
added a commit
that referenced
this pull request
Nov 18, 2026
SentryEnvelopeItem.fromClientReport only throws IOException. The name is fully qualified so this PR doesn't touch the import block, where #6665 adds ExceptionUtils right next to it. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
marked this pull request as ready for review
November 19, 2026 07:40
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 19, 2026 07:40
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d79261d. Configure here.
Sites whose try wraps user or hybrid callbacks, or code from compileOnly modules, can see a LinkageError that is not fatal there, so they move to #6666, which handles it at the call site. The screenshot and replay capture sites move to the bitmap OOM PR, and the callback Javadoc moves with the sites it describes. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 19, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
This goes and adds
ExceptionUtils.rethrowIfFatalas well as a comment all over the codebase where we use catchThrowableThis also adds a Javadoc on the user-facing callbacks says what is dropped when they throw, that the error is logged at ERROR (which prints only with
debugenabled), and that fatal errors are rethrown.Some behavior stays as it was:
💡 Motivation and Context
This is part of the
catch (Throwable)audit.💚 How did you test it?
Didn't, this is just rethrowing fatal errors.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
🤖 Generated with Claude Code