public void SetException (Exception exception)
{
- if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException))
+ if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException, true))
return;
throw new InvalidOperationException ("The task has already completed");