Skip to content

,System.IObservable{--0})} [])} })} ,System.Linq.Expressions.Expression{System.Func{--1,System.IObservable{--0}}})}

Qbservable.Catch(IQbservable, IObservable) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<TSource> Catch<TSource>(this IQbservable<TSource> first, IObservable<TSource> second)
  • 2. public static IQbservable<TSource> Catch<TSource>(this IQbservableProvider provider, params IObservable<TSource>[] sources)
  • 3. public static IQbservable<TSource> Catch<TSource>(this IQbservableProvider provider, IEnumerable<IObservable<TSource>> sources)
  • 4. public static IQbservable<TSource> Catch<TSource, TException>(this IQbservable<TSource> source, Expression<Func<TException, IObservable<TSource>>> handler) where TException : Exception

1. Overload

public static IQbservable<TSource> Catch<TSource>(this IQbservable<TSource> first, IObservable<TSource> second)

Summary: Continues an observable sequence that is terminated by an exception with the next observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence and handler sequence.

Parameters

NameTypeDescription
first[IQbservable](#First observable sequence whose exception (if any) is caught.
secondIObservableSecond observable sequence used to produce results when an error occurred in the first sequence.

Returns: IQbservable -- An observable sequence containing the first sequence's elements, followed by the elements of the second sequence in case an exception occurred.

Exceptions

TypeCondition
System.ArgumentNullExceptionfirst or second is null.

2. Overload

public static IQbservable<TSource> Catch<TSource>(this IQbservableProvider provider, params IObservable<TSource>[] sources)

Summary: Continues an observable sequence that is terminated by an exception with the next observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source and handler sequences.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
params sourcesIObservable<TSource>[]Observable sequences to catch exceptions for.

Returns: IQbservable -- An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.

Exceptions

TypeCondition
System.ArgumentNullExceptionsources is null.

3. Overload

public static IQbservable<TSource> Catch<TSource>(this IQbservableProvider provider, IEnumerable<IObservable<TSource>> sources)

Summary: Continues an observable sequence that is terminated by an exception with the next observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source and handler sequences.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
sourcesIEnumerable>Observable sequences to catch exceptions for.

Returns: IQbservable -- An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.

Exceptions

TypeCondition
System.ArgumentNullExceptionsources is null.

4. Overload

public static IQbservable<TSource> Catch<TSource, TException>(this IQbservable<TSource> source, Expression<Func<TException, IObservable<TSource>>> handler) where TException : Exception

Summary: Continues an observable sequence that is terminated by an exception of the specified type with the observable sequence produced by the handler.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence and sequences returned by the exception handler function.
TExceptionThe type of the exception to catch and handle. Needs to derive from Exception.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence.
handlerExpression>>Exception handler function, producing another observable sequence.

Returns: IQbservable -- An observable sequence containing the source sequence's elements, followed by the elements produced by the handler's resulting observable sequence in case an exception occurred.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or handler is null.