Pass uncaught exception to default handler in GlobalExceptionHandler
Fixes mihonapp/mihon#1347 (cherry picked from commit f3a2f566c8a09ab862758ae69b43da2a2cd8f1db)
This commit is contained in:
parent
5ed4dd409d
commit
38fd20eabf
1 changed files with 3 additions and 12 deletions
|
|
@ -11,7 +11,6 @@ import kotlinx.serialization.encoding.Encoder
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
class GlobalExceptionHandler private constructor(
|
class GlobalExceptionHandler private constructor(
|
||||||
private val applicationContext: Context,
|
private val applicationContext: Context,
|
||||||
|
|
@ -31,17 +30,9 @@ class GlobalExceptionHandler private constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uncaughtException(thread: Thread, exception: Throwable) {
|
override fun uncaughtException(thread: Thread, exception: Throwable) {
|
||||||
try {
|
logcat(priority = LogPriority.ERROR, throwable = exception)
|
||||||
logcat(priority = LogPriority.ERROR, throwable = exception)
|
launchActivity(applicationContext, activityToBeLaunched, exception)
|
||||||
launchActivity(applicationContext, activityToBeLaunched, exception)
|
defaultHandler.uncaughtException(thread, exception)
|
||||||
// KMK -->
|
|
||||||
// Pass the exception to Crashlytics
|
|
||||||
defaultHandler.uncaughtException(thread, exception)
|
|
||||||
// KMK <--
|
|
||||||
exitProcess(0)
|
|
||||||
} catch (_: Exception) {
|
|
||||||
defaultHandler.uncaughtException(thread, exception)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchActivity(
|
private fun launchActivity(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue