Default `OnMethodEnter`/`OnMethodExit` `suppress` behavior
See original GitHub issueIt is rather error prone to require adding suppress
to advice to ensure that exceptions within the advice don’t affect the running application.
Any chance there’s a setting that can change the default behavior of suppress
at runtime? (We’d like different behavior for tests vs release.)
It’s also easy to forget to add onThrowable
, and expect the advice to be run when an exception is thrown but it doesn’t. Having a setting to change this behavior might also be useful.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, this is not yet addressed. I am not certain yet if I want to add a programmatic mechanism here since it changes the behavior of the advice and I am not sure if it makes advice easier to process. For now, I suggest that you add a small build plugin as a linter to fail the build if you find an advice method without the suppression. You could for example add an annotation processor which would even be recognized by IDEs.
Thanks for the explanation. That helps. It sounds like the
suppress
option is still needed. I guess my original request for a way to override the default still applies, but I have a much better understanding how the exception handler is used.