AwaitExtensions.ConfigureAwaitForAggregateException(Task, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an awaitable that will throw AggregateException from the Exception property of the task if it faults.
public static Microsoft.VisualStudio.Threading.AwaitExtensions.AggregateExceptionAwaitable ConfigureAwaitForAggregateException (this System.Threading.Tasks.Task task, bool continueOnCapturedContext = true);
static member ConfigureAwaitForAggregateException : System.Threading.Tasks.Task * bool -> Microsoft.VisualStudio.Threading.AwaitExtensions.AggregateExceptionAwaitable
<Extension()>
Public Function ConfigureAwaitForAggregateException (task As Task, Optional continueOnCapturedContext As Boolean = true) As AwaitExtensions.AggregateExceptionAwaitable
Parameters
- task
- Task
The task to track for completion.
- continueOnCapturedContext
- Boolean
Returns
An awaitable that may throw AggregateException.
Exceptions
Thrown when task
faults.
Remarks
Awaiting a Task with its default TaskAwaiter only throws the first exception within InnerExceptions. When you do not want to lose the detail of other inner exceptions, use this extension method.