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

Add check for faulted task in AsyncInterceptor #53

Conversation

ladenedge
Copy link
Contributor

See #52. This PR adds a check to task.IsFaulted in the post-invoke continuations for the AsyncInterceptor. Exceptions can then be handled via HandleException() rather than throwing when the task.Result is accessed on a faulted task.

Full unit tests are included.

@codecov-io
Copy link

codecov-io commented Nov 27, 2019

Codecov Report

Merging #53 into master will decrease coverage by 1.32%.
The diff coverage is 90.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   72.65%   71.32%   -1.33%     
==========================================
  Files          48       45       -3     
  Lines         969      959      -10     
  Branches        0      156     +156     
==========================================
- Hits          704      684      -20     
+ Misses        265      226      -39     
- Partials        0       49      +49
Impacted Files Coverage Δ
...inject.Extensions.Interception/AsyncInterceptor.cs 89.47% <90.56%> (+2.23%) ⬆️
...t.Extensions.Interception/Infrastructure/Ensure.cs 33.33% <0%> (-33.34%) ⬇️
...nsions.Interception/Request/ProxyRequestFactory.cs 33.33% <0%> (-33.34%) ⬇️
...terception/Registry/MethodInterceptorCollection.cs 75% <0%> (-25%) ⬇️
...nterception/Attributes/NotifyOfChangesAttribute.cs 80% <0%> (-20%) ⬇️
...eption/Infrastructure/Language/KernelExtensions.cs 77.5% <0%> (-13.75%) ⬇️
....Extensions.Interception.DynamicProxy/ProxyBase.cs 73.33% <0%> (-13.34%) ⬇️
...Infrastructure/Language/ExtensionsForMethodInfo.cs 77.77% <0%> (-11.12%) ⬇️
...erception.DynamicProxy/DynamicProxyProxyFactory.cs 81.08% <0%> (-10.82%) ⬇️
...trategies/MethodInterceptorRegistrationStrategy.cs 85% <0%> (-10%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f150c1...4a915ab. Read the comment docs.

…or multiple interceptors. Also full support for HandleExceptions and CompleteInvoke in both async and sync scenarios.
@EugeneKrapivin
Copy link

will anyone event merge this branch? it seem lgtm

@scott-xu scott-xu merged commit a267001 into ninject:master Feb 12, 2021
@scott-xu
Copy link
Member

Thanks! @ladenedge

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

Successfully merging this pull request may close these issues.

5 participants