RxJava
rx.operators
Class OperationOnErrorResumeNextViaFunction<T>
java.lang.Object
rx.operators.OperationOnErrorResumeNextViaFunction<T>
public final class OperationOnErrorResumeNextViaFunction<T>
- extends java.lang.Object
Instruct an Observable to pass control to another Observable (the return value of a function)
rather than invoking onError if it encounters an error.
By default, when an Observable encounters an error that prevents it from emitting the expected
item to its Observer, the Observable invokes its Observer's onError method, and
then quits without invoking any more of its Observer's methods. The onErrorResumeNext operation
changes this behavior. If you pass a function that returns an Observable (resumeFunction) to
onErrorResumeNext, if the source Observable encounters an error, instead of invoking its
Observer's onError method, it will instead relinquish control to this new
Observable, which will invoke the Observer's onNext method if it is able to do so.
In such a case, because no Observable necessarily invokes onError, the Observer may
never know that an error happened.
You can use this to prevent errors from propagating or to supply fallback data should errors be
encountered.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OperationOnErrorResumeNextViaFunction
public OperationOnErrorResumeNextViaFunction()
onErrorResumeNextViaFunction
public static <T> Observable.OnSubscribeFunc<T> onErrorResumeNextViaFunction(Observable<? extends T> originalSequence,
Func1<java.lang.Throwable,? extends Observable<? extends T>> resumeFunction)