Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
su-fenggy opened this issue Oct 31, 2022 · 1 comment

Comments

@su-fenggy
Copy link

su-fenggy commented Oct 31, 2022

调用方法为

 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;
            }
        }
@fs7744 fs7744 closed this as completed in 48bfba2 Nov 3, 2022
@fs7744
Copy link
Owner

fs7744 commented Nov 3, 2022

try 0.0.4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants