Op Englesch liesen Editéieren

Deelen iwwer


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.

C#
public void SetException(System.Collections.Generic.IEnumerable<Exception> exceptions);

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

.NET 10 an aner Versiounen
Produkt Versiounen
.NET 5, 6, 7, 8, 9, 10

SetException(Exception)

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

Transitions the underlying Task into the Faulted state.

C#
public void SetException(Exception 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

.NET 10 an aner Versiounen
Produkt Versiounen
.NET 5, 6, 7, 8, 9, 10