These operators are used to recover from error notifications
Catch
Catch is similar to Try/catch in Java, when an error occurs, you can intercept the call to OnError, so that observable does not terminate because of the error. In Rxjava, this operator is implemented as a 3 operator, respectively:
Onerrorreturn
When an error occurs, let observable launch a pre-defined data and terminate it normally.
Onerrorresume
When an error occurs, another observable replaces the current observable and continues to emit data.
Onexceptionresumenext
Similar to Onerrorresume, the difference is that it will be onerror thrown by the data type to judge, if it is exception, will also use another observable instead of the original observable continue to launch data, Otherwise, the error will be distributed to subscriber.
Retry
Retry, if observable fired an error notification, re-subscribe to it and expect it to terminate normally
The retry operator re-subscribes when an error occurs, and can be repeated several times, so the emitted data can be duplicated. If you repeat the specified number of times and there are errors, the error is returned to the Observer
The Rxjava also implements the Retrywhen operator. When an error occurs, Retrywhen receives OnError's throwable as a parameter and returns a observable based on the defined function, and if the observable launches a data, it is re-subscribed.
RxJava----Operator: error handling