For #2738 - Re-throws exceptions to send better data into the crash reporters
parent
f142be8c92
commit
6527e05405
|
@ -7,6 +7,7 @@ package org.mozilla.fenix
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import io.reactivex.plugins.RxJavaPlugins
|
||||||
import kotlinx.coroutines.Deferred
|
import kotlinx.coroutines.Deferred
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
|
@ -38,6 +39,7 @@ open class FenixApplication : Application() {
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
|
||||||
setupApplication()
|
setupApplication()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +51,7 @@ open class FenixApplication : Application() {
|
||||||
setDayNightTheme()
|
setDayNightTheme()
|
||||||
val megazordEnabled = setupMegazord()
|
val megazordEnabled = setupMegazord()
|
||||||
setupLogging(megazordEnabled)
|
setupLogging(megazordEnabled)
|
||||||
|
registerRxExceptionHandling()
|
||||||
setupCrashReporting()
|
setupCrashReporting()
|
||||||
|
|
||||||
if (!isMainProcess()) {
|
if (!isMainProcess()) {
|
||||||
|
@ -65,6 +68,14 @@ open class FenixApplication : Application() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun registerRxExceptionHandling() {
|
||||||
|
RxJavaPlugins.setErrorHandler {
|
||||||
|
it.cause?.run {
|
||||||
|
throw this
|
||||||
|
} ?: throw it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait until all experiments are loaded
|
* Wait until all experiments are loaded
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue