Skip to content

Commit 7768b80

Browse files
authored
Refine SentryAndroid replay capture logic
Updated SentryAndroid initialization code to capture replay only for crashes.
1 parent e62f6db commit 7768b80

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
SentryAndroid.init(context) { options ->
1313
options.sessionReplay.beforeErrorSampling =
1414
SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
15-
// Skip replay for handled exceptions
16-
val hasUnhandled = event.exceptions?.any { it.mechanism?.isHandled == false } == true
17-
hasUnhandled
15+
// Only capture replay for crashes (excluding e.g. handled exceptions)
16+
event.isCrashed
1817
}
1918
}
2019
```

0 commit comments

Comments
 (0)