-
Notifications
You must be signed in to change notification settings - Fork 116
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
aspect-injector autogenerated methods are displayed in stacktrace #156
Comments
Hi @alexsanv , sorry for delay and thanks for your report! In any case it isn't always possible to hide parts of stacktrace, do you have any specific usecase where for example you parse stacktrace or is it just a matter of convenience? |
@pamidur, this mostly is a matter of convenience. I implemented a helper library\nuget package for NUnit which uses aspect-injector to catch exceptions thrown in NUnit methods (e.g OneTimeSetup) wrapped around (Kind.Around) by aspect. When you investigate a test failure, probably the first thing you look at is the exception's stacktrace. Having aspect-injector's autogenerated methods in exception's stacktrace in test failure may confuse people who are not familiar with the aspect-injector itself or don't even know that it is used in solution (directly or indirectly, as in my case with the library that uses aspect-injector). Does this use case make any sense? |
Yes, totally. To hide them completely we'll need other approach, wild guess - either process the stacktrace and hide frames or probably properly rethrowing exceptions might work as well. Or maybe there are some other attributes to try. Anyway it requires investigation |
@jerviscui , yes it makes sense. With Kind.Exception it is up to user to decide how stack trace looks |
Would it make sense to add StackTraceHiddenAttribute for auto-generated methods? |
omg it exists :) AspectInjector supports all libs that can target netstandard2,0 and netstandard2,0 does not have though I believe we can add this attribute only if target assembly is net6 |
Probably this is a duplicate of #30, but I can reproduce this issue in 2.5.0
Stacktrace:
The text was updated successfully, but these errors were encountered: