System::Threading::Tasks::FromException method

System::Threading::Tasks::FromException(const Exception&) method

Creates a task that has completed with a specified exception.

TaskPtr System::Threading::Tasks::FromException(const Exception &exception)
ParameterTypeDescription
exceptionconst Exception&The exception with which to complete the task.

ReturnValue

A faulted task.

See Also

System::Threading::Tasks::FromException(const Exception&) method

Creates a task that has completed with a specified exception and result type.

template<typename TResult> RTaskPtr<TResult> System::Threading::Tasks::FromException(const Exception &exception)
ParameterDescription
TResultThe type of the task’s result.
ParameterTypeDescription
exceptionconst Exception&The exception with which to complete the task.

ReturnValue

A faulted task with the specified result type.

See Also