mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-26 23:28:58 +03:00
Pass uncaught exception to default handler in GlobalExceptionHandler
Fixes #1347
This commit is contained in:
parent
15e3f28aa3
commit
f3a2f566c8
1 changed files with 3 additions and 8 deletions
|
@ -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,
|
||||
|
@ -31,14 +30,10 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
private fun launchActivity(
|
||||
applicationContext: Context,
|
||||
|
|
Loading…
Reference in a new issue