Repository navigation
ref: Remove Throwable catches that guard nothing (JAVA-552) - #6565
Open
runningcode wants to merge 1 commit into
Open
runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
Nothing in these try blocks can throw, other than an SDK bug or a fatal error that should not be swallowed: FilterString.matches with its precompiled pattern, the StatFs getters, the log and metrics attribute setters, the SHA-1 hash, a substring that is already bounds checked, Baggage's outer header loop, and a submit whose RejectedExecutionException is already caught. Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 9 tasks
📲 Install BuildsAndroid
|
runningcode
marked this pull request as ready for review
November 11, 2026 15:28
runningcode
requested review from
markushi and
romtsn
and removed request for
a team
November 11, 2026 15:28
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
Remove
catch (Throwable)around code that can't throw anything. I had my agent check the history and it couldn't find anything as to why these exist except that they covered different versions of the code that may have needed it before.CheckInUtils,SpanUtilsandTracingUtils:FilterString.matchesuses a pattern thatFilterStringalready compiled, so the "invalid regex" catch can't trigger.💡 Motivation and Context
This is part of the
catch (Throwable)audit. #6564 narrows the catches whose failures are known,and this PR removes the ones that guard nothing. It doesn't depend on #6564.
💚 How did you test it?
Ran the unit tests of
sentry,sentry-android-coreandsentry-jdbc.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Baggage.javaconflicts with ref: Narrow Throwable catches to the exceptions they guard (JAVA-552) #6564, which narrows the per-entry catch this PR re-indents.Whichever PR merges second needs a rebase.
🤖 Generated with Claude Code
#skip-changelog