TaskCompletionSource<TResult>.SetException TaskCompletionSource<TResult>.SetException TaskCompletionSource<TResult>.SetException TaskCompletionSource<TResult>.SetException Method

Definition

Transitions the underlying Task<TResult> object into the Faulted state.

Overloads

SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>)

Transitions the underlying Task<TResult> into the Faulted state and binds a collection of exception objects to it.

SetException(Exception) SetException(Exception) SetException(Exception)

Transitions the underlying Task<TResult> into the Faulted state and binds it to a specified exception.

SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>) SetException(IEnumerable<Exception>)

Transitions the underlying Task<TResult> into the Faulted state and binds a collection of exception objects to it.

public:
 void SetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);
public void SetException (System.Collections.Generic.IEnumerable<Exception> exceptions);
member this.SetException : seq<Exception> -> unit
Public Sub SetException (exceptions As IEnumerable(Of Exception))

Parameters

exceptions
IEnumerable<Exception>

The collection of exceptions to bind to this Task<TResult>.

Exceptions

There are one or more null elements in exceptions.

See also

SetException(Exception) SetException(Exception) SetException(Exception)

Transitions the underlying Task<TResult> into the Faulted state and binds it to a specified exception.

public:
 void SetException(Exception ^ exception);
public void SetException (Exception exception);
member this.SetException : Exception -> unit

Parameters

exception
Exception Exception Exception Exception

The exception to bind to this Task<TResult>.

Exceptions

See also

Applies to