TaskCompletionSource<TResult>.SetException 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.
Transitions the underlying Task<TResult> object into the Faulted state.
Overloads
SetException(IEnumerable<Exception>) |
Transitions the underlying Task<TResult> into the Faulted state and binds a collection of exception objects to it. |
SetException(Exception) |
Transitions the underlying Task<TResult> into the Faulted state and binds it to a specified exception. |
SetException(IEnumerable<Exception>)
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Transitions the underlying Task<TResult> into the Faulted state and binds a collection of exception objects to it.
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))
Parameters
- exceptions
- IEnumerable<Exception>
The collection of exceptions to bind to this Task<TResult>.
Exceptions
The Task was disposed.
The exceptions
argument is null
.
There are one or more null elements in exceptions
.
The underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
See also
Applies to
SetException(Exception)
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Transitions the underlying Task<TResult> into the Faulted state and binds it to a specified exception.
public:
void SetException(Exception ^ exception);
public void SetException (Exception exception);
member this.SetException : Exception -> unit
Public Sub SetException (exception As Exception)
Parameters
- exception
- Exception
The exception to bind to this Task<TResult>.
Exceptions
The Task was disposed.
The exception
argument is null
.
The underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
See also
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기