,--0)} ,System.Func{--1,--0})}
ReactiveExtensions.CatchAndReturn(IObservable, T) method¶
Defined in
Type: ReactiveExtensions
Namespace: ReactiveUI.Extensions
Assembly: ReactiveUI.Extensions.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Overloads¶
- 1.
public static IObservable<T> CatchAndReturn<T>(this IObservable<T> source, T fallback) - 2.
public static IObservable<T> CatchAndReturn<T, TException>(this IObservable<T> source, Func<TException, T> fallbackFactory) where TException : Exception
1. Overload¶
public static IObservable<T> CatchAndReturn<T>(this IObservable<T> source, T fallback)
Summary: Catches any error and returns a fallback value then completes.
Type parameters
| Name | Description |
|---|---|
T | Element type. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
fallback | T | Fallback value. |
Returns: IObservable
2. Overload¶
public static IObservable<T> CatchAndReturn<T, TException>(this IObservable<T> source, Func<TException, T> fallbackFactory) where TException : Exception
Summary: Catches a specific exception type mapping it to a fallback value.
Type parameters
| Name | Description |
|---|---|
T | Element type. |
TException | Exception type. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
fallbackFactory | Func | Factory producing fallback from the exception. |
Returns: IObservable