Skip to content

Add @Throws on SentryOkHttpInterceptor::intercept.#5654

Merged
runningcode merged 1 commit into
getsentry:mainfrom
XYZboom:issue-5653
Jun 29, 2026
Merged

Add @Throws on SentryOkHttpInterceptor::intercept.#5654
runningcode merged 1 commit into
getsentry:mainfrom
XYZboom:issue-5653

Conversation

@XYZboom

@XYZboom XYZboom commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Add a @Throws on SentryOkHttpInterceptor::intercept.

💡 Motivation and Context

Kotlin does not enforce checked exceptions, but Java does, so the @throws annotation on Kotlin methods is necessary for Java interoperability.

resolves: #5653.
resolves: JAVA-594

💚 How did you test it?

There are no logic code changes, so testing is not required.

📝 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.

🔮 Next steps

For Kotlin developers, this is not a breaking change, because the @Throws annotation on Kotlin methods does not change the signature and therefore does not affect compilation. For Java developers, this is a breaking change, because the Java method signature is modified (Java treats thrown exceptions as part of the signature).

@XYZboom

XYZboom commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

For Java, the breaking change is source‑only, easy to fix, and no binary incompatibility has been introduced.

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

@runningcode

Copy link
Copy Markdown
Contributor

@XYZboom looks like there's a changelog conflict. could you rebase? once that's done we can merge.

@XYZboom

XYZboom commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@XYZboom looks like there's a changelog conflict. could you rebase? once that's done we can merge.

Rebase is complete – branch is now clean and up‑to‑date. Ready for your review again. Please let me know if anything else is needed. Thanks.

@runningcode runningcode enabled auto-merge (squash) June 29, 2026 08:48
@runningcode runningcode merged commit 151b497 into getsentry:main Jun 29, 2026
62 checks passed
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.

Missing @Throws annotation on SentryOkHttpInterceptor::intercept

2 participants