Norns.Urd icon indicating copy to clipboard operation
Norns.Urd copied to clipboard

方法在async下,throw异常,会抛出AggregateException 发生一个或多个错误。

Open su-fenggy opened this issue 2 years ago • 0 comments

调用方法为

 public virtual async Task DoAsync()
            {
                if (Count < 50)
                {
                    Count++;
                    throw new FieldAccessException();
                }

                await Task.Yield();

            }

在IInterceptorCreator.cs中,注释一下三行代码即可解决

 public static async Task Await(Task task)
        {
            //if (!task.IsCompleted)
            {
                await task;
            }
        }

        public static async Task AwaitValueTask(ValueTask task)
        {
            //if (!task.IsCompleted)
            {
                await task;
            }
        }

        public static async Task AwaitValueTaskReturnValue<T>(ValueTask<T> task)
        {
            //if (!task.IsCompleted)
            {
                await task;
            }
        }

su-fenggy avatar Oct 31 '22 15:10 su-fenggy