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

Instances of Log & Throw #547

Closed
dansiviter opened this issue Apr 22, 2022 · 1 comment
Closed

Instances of Log & Throw #547

dansiviter opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
bug Something isn't working right

Comments

@dansiviter
Copy link
Contributor

Describe the bug
Log and throw is generally considered an anti-pattern but there are multiple instances where this is happenening:

Log & Throw needlessly pollutes the logs and adds no value over and above the exception. It should be down to the developer if they handle and log the exception.

There are potentially more incidents of this.

To Reproduce
Deserialise a bad payload to force an exception to be thrown. The following log is observed:

2022.04.21 19:17:27 SEVERE org.eclipse.yasson.internal.DeserializationContextImpl Thread[helidon-1,5,server]: Unable to deserialize property 'foo' because of: Error deserialize JSON value into type: int.

Expected behavior
Only the exceptions should be thrown and no log messages should be written.

System information:

  • OS: Linux
  • Java Version: 17
  • Yasson Version: 3.0.0-RC1

Additional context
Workaround is to selectively disable logging, but as this is often set to SEVERE then other messages may be missed.

@dansiviter dansiviter added the bug Something isn't working right label Apr 22, 2022
dansiviter added a commit to dansiviter/yasson that referenced this issue Apr 23, 2022
@Verdent
Copy link
Member

Verdent commented Apr 26, 2022

Fixed by #548

@Verdent Verdent closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

2 participants