/// <summary> /// Return exception to stack. Must be in Unity thread! /// </summary> /// <param name="task">source task</param> /// <param name="ignoreCancel">ignore OperationCanceledException</param> public static void RethrowError(this IPandaTask task, bool ignoreCancel = false) { //throw task.Fail(x => { //not throw if no task canceled exception mode. if (ignoreCancel && x is OperationCanceledException) { return; } //throw to stack. task.ThrowIfError(); }); }
public void GetResult() { _task.ThrowIfError(); }