Class Catch
Represents an operator that continues an observable sequence that is terminated by an exception with the next observable sequence.
The Catch operator allows you to handle error notifications from a sequence by combining the output of multiple fallback sequences of the same type into a single sequence. Catch subscribes to the next sequence when the previous sequence produces an error, and emits all the values from that sequence until successful termination. If that sequence also terminates exceptionally, Catch then subscribes to the next sequence, and so forth. Each sequence is guaranteed to only start after the previous one terminates.
The resulting sequence will terminate successfully when any of the source sequences has terminated successfully, or exceptionally when all sequences have terminated with an error.
Examples
Use Catch to continue an observable sequence that terminates with an exception. The second sequence is subscribed only if the first sequence produces an error.
Related Operators
Use Retry instead to repeat subscription to the observable sequence if it terminates with an exception.
Use OnErrorResumeNext instead to avoid raising an exception when all sequences have terminated with an error.
[Combinator]
public class Catch
- Inheritance
-
Catch
- Inherited Members
Methods
- Process<TSource>(IObservable<TSource>, IObservable<TSource>)
Continues an observable sequence that is terminated by an exception with the next observable sequence.
- Process<TSource>(params IObservable<TSource>[])
Continues an observable sequence that is terminated by an exception with the next observable sequence.