Top Description Fields Constructors Methods
rx.internal.operators

public final Class OperatorOnErrorResumeNextViaFunction<T>

extends Object
implements Observable.Operator<T, T>
Class Inheritance
All Implemented Interfaces
rx.Observable.Operator, rx.functions.Func1, rx.functions.Function
Type Parameters
<T>
the value type
Imports
rx.*, .Observable.Operator, rx.exceptions.Exceptions, rx.functions.Func1, rx.internal.producers.ProducerArbiter, rx.plugins.RxJavaHooks, rx.subscriptions.SerialSubscription

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.

Field Summary

Modifier and TypeField and Description
pack-priv final Func1<? super Throwable, ? extends Observable<? extends T>>

Constructor Summary

AccessConstructor and Description
public
OperatorOnErrorResumeNextViaFunction(Func1<? super Throwable, ? extends Observable<? extends T>> f)

Method Summary

Modifier and TypeMethod and Description
public Subscriber<? super T>
call(final Subscriber<? super T> child)

Implements rx.functions.Func1.call.

public static <T> OperatorOnErrorResumeNextViaFunction<T>
withException(final Observable<? extends T> other)

public static <T> OperatorOnErrorResumeNextViaFunction<T>
withOther(final Observable<? extends T> other)

public static <T> OperatorOnErrorResumeNextViaFunction<T>
withSingle(final Func1<? super Throwable, ? extends T> resumeFunction)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

resumeFunctionback to summary
pack-priv final Func1<? super Throwable, ? extends Observable<? extends T>> resumeFunction

Constructor Detail

OperatorOnErrorResumeNextViaFunctionback to summary
public OperatorOnErrorResumeNextViaFunction(Func1<? super Throwable, ? extends Observable<? extends T>> f)

Method Detail

callback to summary
public Subscriber<? super T> call(final Subscriber<? super T> child)

Implements rx.functions.Func1.call.

Annotations
@Override
withExceptionback to summary
public static <T> OperatorOnErrorResumeNextViaFunction<T> withException(final Observable<? extends T> other)
withOtherback to summary
public static <T> OperatorOnErrorResumeNextViaFunction<T> withOther(final Observable<? extends T> other)
withSingleback to summary
public static <T> OperatorOnErrorResumeNextViaFunction<T> withSingle(final Func1<? super Throwable, ? extends T> resumeFunction)