Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetException() [3/3]

static void System.Runtime.CompilerServices.AsyncTaskMethodBuilder< TResult >.SetException ( Exception exception,
ref Task< TResult > taskField )
inlinestaticpackage

Definition at line 354 of file AsyncTaskMethodBuilder.cs.

355 {
356 if (exception == null)
357 {
358 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.exception);
359 }
360 Task<TResult> task = taskField ?? (taskField = new Task<TResult>());
361 if (!((exception is OperationCanceledException ex) ? task.TrySetCanceled(ex.CancellationToken, ex) : task.TrySetException(exception)))
362 {
363 ThrowHelper.ThrowInvalidOperationException(ExceptionResource.TaskT_TransitionToFinal_AlreadyCompleted);
364 }
365 }

References System.exception, System.task, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowInvalidOperationException().