TaskCompletionSource<TResult>.SetException method

Transitions the underlying task into the Faulted state and binds it to the specified exception.

public virtual void SetException(Exception exception)
parameter description
exception The exception to bind to this task.


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

See Also