Attempts to transition the underlying
Task<(Of <(TResult>)>) into the
Faulted
state.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function TrySetException ( _
exceptions As IEnumerable(Of Exception) _
) As Boolean |
C# |
---|
public bool TrySetException(
IEnumerable<Exception> exceptions
) |
Parameters
- exceptions
- Type: System.Collections.Generic..::.IEnumerable<(Of <(Exception>)>)
The collection of exceptions to bind to this Task<(Of <(TResult>)>).
Return Value
True if the operation was successful; otherwise, false.
Remarks
Exceptions
Exception | Condition |
---|
System..::.ArgumentNullException | The exceptions argument is null. |
System..::.ArgumentException | There are one or more null elements in exceptions. |
System..::.ArgumentException | The exceptions collection is empty. |
System..::.ObjectDisposedException | The Task was disposed. |
See Also