mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 14:50:30 +05:30
13 lines
494 B
Kotlin
13 lines
494 B
Kotlin
package com.github.libretube.util
|
|
|
|
class ExceptionHandler(
|
|
private val defaultExceptionHandler: Thread.UncaughtExceptionHandler?
|
|
) : Thread.UncaughtExceptionHandler {
|
|
override fun uncaughtException(thread: Thread, exc: Throwable) {
|
|
// save the error log
|
|
PreferenceHelper.saveErrorLog(exc.stackTraceToString())
|
|
// throw the exception with the default exception handler to make the app crash
|
|
defaultExceptionHandler?.uncaughtException(thread, exc)
|
|
}
|
|
}
|