Class CatchErrorOperator
Implements the CatchError operator. Mirrors rxjs's catchError.
public static class CatchErrorOperator
- Inheritance
-
System.ObjectCatchErrorOperator
Methods
CatchError<T>(Observable<T>, Func<Exception, Observable<T>>)
Recovers from an error on source by subscribing to a replacement observable produced by
selector, instead of propagating the error to the subscriber.
public static Observable<T> CatchError<T>(this Observable<T> source, Func<Exception, Observable<T>> selector)
Parameters
sourceObservable<T>The source observable to catch errors from.
selectorFunc<Exception, Observable<T>>A function that maps the error to a replacement observable to continue with.
Returns
- Observable<T>
An observable that mirrors
sourceuntil it errors, then mirrors the replacement observable produced byselector.
Type Parameters
TThe element type of both the source and the replacement observable.
Remarks
Values and completion from source pass through unchanged; only an error notification is
intercepted. If selector itself throws, that exception is forwarded via OnError
instead of the original one.