Skip to content

Commit

Permalink
Pass uncaught exception to default handler in GlobalExceptionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
AntsyLich committed Oct 19, 2024
1 parent 15e3f28 commit f3a2f56
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlinx.serialization.encoding.Encoder
import kotlinx.serialization.json.Json
import logcat.LogPriority
import tachiyomi.core.common.util.system.logcat
import kotlin.system.exitProcess

class GlobalExceptionHandler private constructor(
private val applicationContext: Context,
Expand All @@ -31,13 +30,9 @@ class GlobalExceptionHandler private constructor(
}

override fun uncaughtException(thread: Thread, exception: Throwable) {
try {
logcat(priority = LogPriority.ERROR, throwable = exception)
launchActivity(applicationContext, activityToBeLaunched, exception)
exitProcess(0)
} catch (_: Exception) {
defaultHandler.uncaughtException(thread, exception)
}
logcat(priority = LogPriority.ERROR, throwable = exception)
launchActivity(applicationContext, activityToBeLaunched, exception)
defaultHandler.uncaughtException(thread, exception)
}

private fun launchActivity(
Expand Down

0 comments on commit f3a2f56

Please sign in to comment.