concept Catch in category .net

This is an excerpt from Manning's book Rx.NET in Action.
Semantically, the Rx Catch operator does the same thing, handling a specific exception type, but the way to specify the continuation of execution is by stipulating a fallback observable. In the case of an error, the observer is subscribed to the fallback observable (figure 11.2).
Figure 11.2. The Catch operator lets you handle a specific exception type and set a fallback observable in case an exception is thrown.
![]()
In the next example, you improve the error handling for the weather simulation observable shown in listing 11.1. Now, you add the Catch operator to handle the OutOfMemoryException and gracefully close the observable pipeline:
Catch receives a function that handles a specific exception type; the function returns the observable that will be used for continuing execution of the observable pipeline. In this example, you return an empty observable so that the observable pipeline will complete, but in your code, this can be a fallback observable that will emit values instead of the original observable.
IObservable<TSource> Catch<TSource, TException>( IObservable<TSource> source, Func<TException, IObservable<TSource>> handler) where TException : Exception