แก้ไข

แชร์ผ่าน


TaskCompletionSource.SetException Method

Definition

Overloads

SetException(IEnumerable<Exception>)

Transitions the underlying Task into the Faulted state.

SetException(Exception)

Transitions the underlying Task into the Faulted state.

SetException(IEnumerable<Exception>)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Transitions the underlying Task into the Faulted state.

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.

Exceptions

exceptions is null.

There are one or more null elements in exceptions.

The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to

SetException(Exception)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Transitions the underlying Task into the Faulted state.

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

Parameters

exception
Exception

The exception to bind to this Task.

Exceptions

exception is null.

The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to