AwaitExtensions.ConfigureAwaitForAggregateException(Task, Boolean) 方法

定义

如果错误,则返回将 AggregateException 从任务的属性引发的可等待 Exception

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

参数

task
Task

要跟踪完成的任务。

continueOnCapturedContext
Boolean

返回

AwaitExtensions.AggregateExceptionAwaitable

可能引发的可等待 AggregateException

例外

出现错误时引发 task

注解

如果等待的 Task 默认值 TaskAwaiter 仅引发中的第一个异常,则为 InnerExceptions 。 如果你不希望丢失其他内部异常的详细信息,请使用此扩展方法。

适用于