I have a general error handling solution in my app which should be invoked whenever onError
is called. Instead of implementing onError
for every subscribe
I have done this inside the Application
class:
RxJavaPlugins.getInstance().registerErrorHandler(new RxJavaErrorHandler() {
@Override
public void handleError(final Throwable throwable) {
new ErrorHandler().call(throwable);
}
});
However I would like to have the ability to override this by implementing onError
, and according to:
https://github.com/ReactiveX/RxJava/wiki/Plugins#rxjavaerrorhandler
This plugin allows you to register a function that will handle errors that are raised by RxJava but that cannot be handled by the ordinary RxJava onError notification process (for instance, if RxJava tries to propagate an error to a subscriber that has not implemented an onError handler).
This should have been the case where I have implemented onError
. However when running the code handleError
inside RxJavaErrorHandler
still gets invoked first, even though I have implemented onError
.
Update:
According to zsxwing, the wiki has been updated with the correct description of RxJavaErrorHandler
.