mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
18 lines
568 B
Kotlin
18 lines
568 B
Kotlin
|
package com.github.libretube.util
|
||
|
|
||
|
import android.util.Log
|
||
|
import com.github.libretube.preferences.PreferenceHelper
|
||
|
import kotlin.system.exitProcess
|
||
|
|
||
|
class ExceptionHandler : Thread.UncaughtExceptionHandler {
|
||
|
override fun uncaughtException(thread: Thread, exc: Throwable) {
|
||
|
Log.e("bnyro", exc.stackTraceToString())
|
||
|
// sav ethe error log
|
||
|
PreferenceHelper.saveErrorLog(exc.stackTraceToString())
|
||
|
// finish the app
|
||
|
System.exit(0)
|
||
|
android.os.Process.killProcess(android.os.Process.myPid())
|
||
|
exitProcess(0)
|
||
|
}
|
||
|
}
|