-
Notifications
You must be signed in to change notification settings - Fork 27
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
AsyncInterceptor cannot handle exeptions #52
Comments
ladenedge
pushed a commit
to ladenedge/Ninject.Extensions.Interception
that referenced
this issue
Nov 27, 2019
Please see #53 for the PR that resolves this issue. Thank you! |
ladenedge
pushed a commit
to ladenedge/Ninject.Extensions.Interception
that referenced
this issue
Dec 5, 2019
…or multiple interceptors. Also full support for HandleExceptions and CompleteInvoke in both async and sync scenarios.
scott-xu
pushed a commit
that referenced
this issue
Feb 12, 2021
* #52 - Added check for faulted task in AsyncInterceptor and associated tests. * Reverted a C# 8 feature. * #52 - The AsyncInterceptor now "pipelines" results, allowing for multiple interceptors. Also full support for HandleExceptions and CompleteInvoke in both async and sync scenarios. Co-authored-by: Jay Miller <[email protected]>
Any chance of releasing the nuget package which includes this fix? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AsyncInterceptor is awesome, but it cannot handle faulted tasks.
On first glance it looks like one could override
AfterInvoke(IInvocation invocation, Task task)
and check theIsFaulted
property of the task, but the lastContinueWith()
contains this code:Thus,
AfterInvoke()
is only called iftask.Result
does not throw—which it will if the task is faulted!What I believe is needed is a check of
t.IsFaulted
before accessingt.Result
and then calling the virtual methods appropriately.The text was updated successfully, but these errors were encountered: