Skip to content

Commit

Permalink
runCatching ANR recording (#4434)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/488551667048375/1207070178029312/f

### Description
try-catch ANR recording to avoid unintended crashes like OOM

### Steps to test this PR
NA, just code review
  • Loading branch information
aitorvs authored Apr 16, 2024
1 parent 60b092c commit 70c8ece
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ class GlobalUncaughtExceptionHandler @Inject constructor(
thread: Thread?,
originalException: Throwable?,
) {
if (shouldRecordExceptionAndCrashApp(originalException)) {
recordExceptionAndAllowCrash(thread, originalException)
return
runCatching {
if (shouldRecordExceptionAndCrashApp(originalException)) {
recordExceptionAndAllowCrash(thread, originalException)
return
}
}
}

Expand Down

0 comments on commit 70c8ece

Please sign in to comment.