TaskCompletionSource.TrySetException 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.
Overloads
TrySetException(IEnumerable<Exception>) |
Attempts to transition the underlying Task into the Faulted state. |
TrySetException(Exception) |
Attempts to transition the underlying Task into the Faulted state. |
TrySetException(IEnumerable<Exception>)
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
public:
bool TrySetException(System::Collections::Generic::IEnumerable<Exception ^> ^ exceptions);
public bool TrySetException (System.Collections.Generic.IEnumerable<Exception> exceptions);
member this.TrySetException : seq<Exception> -> bool
Public Function TrySetException (exceptions As IEnumerable(Of Exception)) As Boolean
Parameters
- exceptions
- IEnumerable<Exception>
The collection of exceptions to bind to this Task.
Returns
true
if the operation was successful; otherwise, false
.
Exceptions
exceptions
is null
.
There are one or more null
elements in exceptions
.
The exceptions
collection is empty.
Remarks
This operation will return false
if the Task is already in one of the three final states:
RanToCompletion, Faulted, or Canceled.
Applies to
TrySetException(Exception)
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
- Source:
- TaskCompletionSource.cs
public:
bool TrySetException(Exception ^ exception);
public bool TrySetException (Exception exception);
member this.TrySetException : Exception -> bool
Public Function TrySetException (exception As Exception) As Boolean
Parameters
Returns
true
if the operation was successful; otherwise, false
.
Exceptions
exception
is null
.
Remarks
This operation will return false
if the Task is already in one of the three final states:
RanToCompletion, Faulted, or Canceled.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기