is there any convenient way to get object which caused any exception in onError handler?
I want to do something like:
observable.subscribe(
unit -> {
//something can throw ex here..
},
error->logger.error("error on {}", unit, error));
Some errors will connect to a value, such as errors from map
or filter
. RxJava will call onError(rx.exceptions.OnErrorThrowable)
for such errors. You can get the value from OnErrorThrowable.getValue
.
However, some errors won't connect to a value. RxJava will just send the error directly to onError
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With