Ignore interrupted exception in setupRx

This commit is contained in:
Valere 2020-02-05 22:11:58 +01:00
parent bf2e01b8c3
commit 3e2219cbb5

View File

@ -31,11 +31,14 @@ class RxConfig @Inject constructor(
fun setupRxPlugin() {
RxJavaPlugins.setErrorHandler { throwable ->
Timber.e(throwable, "RxError")
// Avoid crash in production, except if user wants it
if (vectorPreferences.failFast()) {
throw throwable
//is InterruptedException -> fine, some blocking code was interrupted by a dispose call
if (throwable !is InterruptedException) {
// Avoid crash in production, except if user wants it
if (vectorPreferences.failFast()) {
throw throwable
}
}
}
}
}