Part of #5634. Blocked by getsentry/sentry-java#6141, and a Java SDK bump to the release that ships it.
Branch: main. No public API change, and getsentry/sentry-java#6141 targets sentry-java 8.x, so the fix arrives with a regular Java SDK bump.
When the user's BeforeSend throws on a native Android event, #5610's BeforeSendWrapper returns null (Platforms/Android/SentrySdk.cs:246-255). sentry-java then counts before_send / error (SentryClient.java:171-177). sentry-java 8.58.0 has no callback_error reason yet (DiscardReason.java).
getsentry/sentry-java#6141 (part of getsentry/sentry-java#6081) adds DiscardReason.CALLBACK_ERROR and records it when a beforeSend* callback throws. sentry-java already drops the event on a throw; it just counts it as before_send today.
To investigate once it ships
Instead of returning null, BeforeSendCallback.Execute could throw a Java exception. sentry-java would then drop the event and count callback_error itself. This depends on how .NET for Android marshals managed exceptions across JNI, which needs checking on a device.
Part of #5634. Blocked by getsentry/sentry-java#6141, and a Java SDK bump to the release that ships it.
Branch:
main. No public API change, and getsentry/sentry-java#6141 targets sentry-java 8.x, so the fix arrives with a regular Java SDK bump.When the user's
BeforeSendthrows on a native Android event, #5610'sBeforeSendWrapperreturnsnull(Platforms/Android/SentrySdk.cs:246-255). sentry-java then countsbefore_send/error(SentryClient.java:171-177). sentry-java 8.58.0 has nocallback_errorreason yet (DiscardReason.java).getsentry/sentry-java#6141 (part of getsentry/sentry-java#6081) adds
DiscardReason.CALLBACK_ERRORand records it when abeforeSend*callback throws. sentry-java already drops the event on a throw; it just counts it asbefore_sendtoday.To investigate once it ships
Instead of returning
null,BeforeSendCallback.Executecould throw a Java exception. sentry-java would then drop the event and countcallback_erroritself. This depends on how .NET for Android marshals managed exceptions across JNI, which needs checking on a device.