Table of Contents

Class CatchErrorOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Implements the CatchError operator. Mirrors rxjs's catchError.

public static class CatchErrorOperator
Inheritance
System.Object
CatchErrorOperator

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

source Observable<T>

The source observable to catch errors from.

selector Func<Exception, Observable<T>>

A function that maps the error to a replacement observable to continue with.

Returns

Observable<T>

An observable that mirrors source until it errors, then mirrors the replacement observable produced by selector.

Type Parameters

T

The 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.