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

Ignore Exceptions, but log them #92

Closed
TheNitek opened this issue Jul 25, 2017 · 10 comments
Closed

Ignore Exceptions, but log them #92

TheNitek opened this issue Jul 25, 2017 · 10 comments

Comments

@TheNitek
Copy link

I have a few situations where I don't want certain exceptions to interrupt my wait, but for debugging purposes it's quite valuable to have the information that this exception occured. Therefore it would be nice to be able to register a ExceptionListener (or extend the ConditionEvaluationListener) to handle those exceptions.

@johanhaleby
Copy link
Collaborator

Isn't it possible to combine given().ignoreException(..) with a ConditionEvaluationListener?

@TheNitek
Copy link
Author

I think I got it working by (mis-)using ignoreExceptionsMatching(...) with my logging code and return true, but it doesn't feel like good solution ...

@johanhaleby
Copy link
Collaborator

No that's not an optimal solution. But couldn't you use ignoreException* for ignoring the exception(s) and an ConditionEvaluationListener for logging purposes?

@TheNitek
Copy link
Author

But I cannot get the Exception information in the Listener, can I?

@johanhaleby
Copy link
Collaborator

Not atm, but perhaps it would be a good idea to add this? Would that solve your problem?

@TheNitek
Copy link
Author

Yes, that would be a good solution!

@grofoli
Copy link
Contributor

grofoli commented Dec 3, 2019

@johanhaleby What do you think about this issue today (after more than two years)? If you think this is still a good a idea/meaningful feature, then I can probably tackle this. What solution would you prefer? Should I introduce a new method in the ConditionEvaluationListener like onException ?

@johanhaleby
Copy link
Collaborator

@grofoli That would be really helpful!

grofoli added a commit to grofoli/awaitility that referenced this issue Dec 4, 2019
grofoli added a commit to grofoli/awaitility that referenced this issue Dec 4, 2019
@grofoli
Copy link
Contributor

grofoli commented Dec 4, 2019

@johanhaleby I hope you like the PR.

grofoli added a commit to grofoli/awaitility that referenced this issue Dec 8, 2019
johanhaleby pushed a commit that referenced this issue Dec 9, 2019
* Ignore Exceptions, but log them
* #92

* Renamed trace to throwable in IgnoredException container
* #92
@erwinw
Copy link

erwinw commented Jan 17, 2024

@ johanhaleby I hope you like the PR.

Years later, but ... I really appreciate this API change (and the rest of the project!) -- thanks!

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

No branches or pull requests

4 participants