/// <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();
            });
        }
Example #2
0
 public void GetResult()
 {
     _task.ThrowIfError();
 }