SetException() public method

Transitions the underlying Task into the TaskStatus.Faulted state.
The underlying has already been completed.
public SetException ( Exception exception ) : void
exception System.Exception The exception to bind to this . May not be null.
return void
Ejemplo n.º 1
0
 /// <summary>
 /// Transitions the underlying <see cref="Task"/> into the <see cref="TaskStatus.Faulted"/> state.
 /// </summary>
 /// <param name="exception">The exception to bind to this <see cref="Task"/>. May not be <c>null</c>.</param>
 /// <exception cref="InvalidOperationException">The underlying <see cref="Task"/> has already been completed.</exception>
 public void SetException(Exception exception)
 {
     _tcs.SetException(exception);
 }