ValueTask.FromException Method

Definition

Overloads

FromException(Exception)

Creates a ValueTask that has completed with the specified exception.

FromException<TResult>(Exception)

Creates a ValueTask<TResult> that has completed with the specified exception.

FromException(Exception)

Creates a ValueTask that has completed with the specified exception.

public:
 static System::Threading::Tasks::ValueTask FromException(Exception ^ exception);
public static System.Threading.Tasks.ValueTask FromException (Exception exception);
static member FromException : Exception -> System.Threading.Tasks.ValueTask
Public Shared Function FromException (exception As Exception) As ValueTask

Parameters

exception
Exception

The exception with which to complete the task.

Returns

ValueTask

The faulted task.

Applies to

FromException<TResult>(Exception)

Creates a ValueTask<TResult> that has completed with the specified exception.

public:
generic <typename TResult>
 static System::Threading::Tasks::ValueTask<TResult> FromException(Exception ^ exception);
public static System.Threading.Tasks.ValueTask<TResult> FromException<TResult> (Exception exception);
static member FromException : Exception -> System.Threading.Tasks.ValueTask<'Result>
Public Shared Function FromException(Of TResult) (exception As Exception) As ValueTask(Of TResult)

Type Parameters

TResult

The type of the result of the returned task.

Parameters

exception
Exception

The exception with which to complete the task.

Returns

ValueTask<TResult>

The faulted task.

Applies to