Skip to content

)}

ObservableAsync.OnErrorResumeAsFailure(IObservableAsync) method

Defined in

Type: ObservableAsync Namespace: ReactiveUI.Extensions.Async 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

public static IObservableAsync<T> OnErrorResumeAsFailure<T>(this IObservableAsync<T> @this)

View source

Summary: Creates a new observable sequence that converts any error encountered in the source sequence into a failure result, allowing the sequence to complete without propagating exceptions.

Type parameters

NameDescription
TThe type of the elements in the observable sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source asynchronous observable sequence to monitor for errors.

Returns: IObservableAsync -- An observable sequence that emits the same elements as the source, but represents errors as failure results instead of throwing exceptions.

Remarks

This method enables error handling by transforming exceptions into failure notifications within the sequence, rather than terminating the sequence with an error. Consumers can inspect the result to determine whether an operation succeeded or failed.