Task.Exception property

Gets the AggregateException that caused the task to end prematurely. If the task completed successfully or has not yet thrown any exceptions, this will return null.

public AggregateException Exception { get; }

See Also