question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default `OnMethodEnter`/`OnMethodExit` `suppress` behavior

See original GitHub issue

It 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:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, Feb 26, 2021

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.

0reactions
tylerbensoncommented, Feb 25, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found