T
- the value typepublic final class OperatorOnExceptionResumeNextViaObservable<T> extends java.lang.Object implements Observable.Operator<T,T>
onError
if it encounters an error of type Exception
.
This differs from Observable.onErrorResumeNext(rx.functions.Func1<java.lang.Throwable, ? extends rx.Observable<? extends T>>)
in that this one does not handle
Throwable
or Error
but lets those continue through.
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 an Observable (resumeSequence) 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.
Constructor and Description |
---|
OperatorOnExceptionResumeNextViaObservable(Observable<? extends T> resumeSequence) |
Modifier and Type | Method and Description |
---|---|
Subscriber<? super T> |
call(Subscriber<? super T> child) |
public OperatorOnExceptionResumeNextViaObservable(Observable<? extends T> resumeSequence)
public Subscriber<? super T> call(Subscriber<? super T> child)
call
in interface Func1<Subscriber<? super T>,Subscriber<? super T>>