Skip to content

ref: Remove the remaining Throwable catches that guard nothing (JAVA-552) - #6668

Draft
runningcode wants to merge 1 commit into
9.x.xfrom
no/java-552-remove-unneeded-catches
Draft

runningcode wants to merge 1 commit into
9.x.xfrom
no/java-552-remove-unneeded-catches

Conversation

@runningcode

@runningcode runningcode commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Remove 3 catch (Throwable) blocks that guard nothing:

  • ClientReportRecorder.recordLostEnvelope and recordLostEvent: their callees, recordLostEnvelopeItem and executeOnDiscard, already catch their own failures, and the rest only updates counters.
  • ContextUtils, around the split APK info: DeviceInfoUtil.getSplitApksInfo() returns a field it filled in its constructor.

No behavior changes.

💡 Motivation and Context

This is part of the catch (Throwable) audit. #6565 removed the first 15 of these. These three came out of the boundary pass in #6657 and #6658.

This PR is independent of its siblings and they can merge in any order:

💚 How did you test it?

  • The existing unit tests of sentry and sentry-android-core.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

#skip-changelog

🤖 Generated with Claude Code

The catches in ClientReportRecorder.recordLostEnvelope and recordLostEvent wrap callees that already catch their own failures, and the one in ContextUtils wraps a read of split APK info that DeviceInfoUtil has already cached.

Refs #5513

Refs JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

JAVA-552

@sentry

sentry Bot commented Nov 18, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant