TaskCompletionSource.SetException 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
SetException(IEnumerable<Exception>) | |
SetException(Exception) |
SetException(IEnumerable<Exception>)
public:
void SetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);
public void SetException (System.Collections.Generic.IEnumerable<Exception> exceptions);
member this.SetException : seq<Exception> -> unit
Public Sub SetException (exceptions As IEnumerable(Of Exception))
参数
- exceptions
- IEnumerable<Exception>
要绑定到此 Task 的异常的集合。
例外
exceptions
为 null
。
exceptions
中有一个或多个 null
元素。
基础 Task 已处于以下三种最终状态的其中一种:RanToCompletion、Faulted 或 Canceled。
适用于
SetException(Exception)
public:
void SetException(Exception ^ exception);
public void SetException (Exception exception);
member this.SetException : Exception -> unit
Public Sub SetException (exception As Exception)
参数
例外
exception
为 null
。
基础 Task 已处于以下三种最终状态的其中一种:RanToCompletion、Faulted 或 Canceled。