I have question about RxJava global handler and Android Vitals. In Android Vitals I can see
io.reactivex.exceptions.UndeliverableException
Caused by: java.lang.InterruptedException: at com.google.common.util.concurrent.AbstractFuture.get (AbstractFuture.java:527) at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get (FluentFuture.java:82)
But already I don't know where is the problem so I thought about adding RxJava global error handler:
RxJavaPlugins.setErrorHandler(e -> {
if (e instanceof UndeliverableException) {
e = e.getCause();
}
if ((e instanceof IOException) || (e instanceof SocketException)) {
// fine, irrelevant network problem or API that throws on cancellation
return;
}
if (e instanceof InterruptedException) {
// fine, some blocking code was interrupted by a dispose call
return;
}
if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) {
// that's likely a bug in the application
Thread.currentThread().getUncaughtExceptionHandler()
.handleException(Thread.currentThread(), e);
return;
}
if (e instanceof IllegalStateException) {
// that's a bug in RxJava or in a custom operator
Thread.currentThread().getUncaughtExceptionHandler()
.handleException(Thread.currentThread(), e);
return;
}
Log.warning("Undeliverable exception received, not sure what to do", e);
});
And there is my question. If I will add global error handler I will lost reports from Android Vitals ? By lost I mean there will be no new reports becase we will handle the error which causing crash.
Is it possible to add global error handler and still get reports in Android Vitals ?