Skip to content

Commit c38c9f9

Browse files
ref(android): Clarify non-terminating unhandled detection
Check for an unhandled exception directly instead of using the crash-named predicate in a path where the process intentionally continues. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c6f705c commit c38c9f9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,7 @@ public static SentryId captureEnvelopeNonTerminating(final @NotNull byte[] envel
260260
for (SentryEnvelopeItem item : envelope.getItems()) {
261261
final SentryEvent event = item.getEvent(serializer);
262262
if (event != null) {
263-
// isCrashed() means mechanism.handled=false (unhandled exception), not that the
264-
// process terminated. For e.g Flutter that distinction is why we only mark pending here.
265-
if (event.isCrashed()) {
263+
if (event.getUnhandledException() != null) {
266264
markPendingUnhandled = true;
267265
addErrorsCount = true;
268266
} else if (event.isErrored()) {

0 commit comments

Comments
 (0)