-
Notifications
You must be signed in to change notification settings - Fork 76
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
Decorating "async void" method throws weaver exception for aspect with OnException override #111
Comments
Does it compile if you provide empty overrides for OnEntry and OnExit methods? |
Im afraid not. As soon as OnException is in the code it stops compiling, with or without OnEntry and OnExit. |
Can you try to return a Task or an int from the GetAsync() method? Maybe there are problems with fire and forget async method weaving |
That worked!
|
Great. Then this should also be reproducible if the attribute is just decorating the GetAsync() method if it returns void? |
Yes, by having this on method level, its the same behavior. With and with out returning Task. |
So then the bug is handling of void async methods. So all in all you have a workaround and we can then create a test case for the issue |
any workaround for this issue? |
Sort of. Have to return a task, just read above. |
So, the thing is I have this injection script I run on all my source files so they can all be monitored and observed for issues.
It works well, instead of just do all of this manually.
I have these put on class level, not on individual methods like the example bellow.
How ever as Im only interested in capturing Exceptions at this stage, I have the ExceptionLogger it self look like this
This how ever will cause the weaver to drop error message on by that not compile.
This only happens when dealing with OnException on class level, OnEntry and OnExit passes just fine.
Is there anything that can be done to deal with an issue like this?
The text was updated successfully, but these errors were encountered: