Skip to content

Conversation

@pkoenig10
Copy link
Member

@pkoenig10 pkoenig10 commented Sep 26, 2018

ErrorType is a safe-loggable arg of a ServiceException. Our internal logging library logs arg values using an object mapper. However ErrorType does not have JSON property annotations and consequently always gets serialized as "{}", which is not very helpful.

@pkoenig10 pkoenig10 requested a review from a team as a code owner September 26, 2018 07:09
@ImmutablesStyle
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(as = ImmutableErrorType.class)
@JsonDeserialize(as = ImmutableErrorType.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need deserialization?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know of, is there harm in allow it to be deserialized?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow deserialization gives the impression that this is used as wire format, but that's not the case

@pkoenig10
Copy link
Member Author

Closing in favor of #131

@pkoenig10 pkoenig10 closed this Sep 26, 2018
@pkoenig10 pkoenig10 deleted the errorTypeJson branch September 26, 2018 20:30
bulldozer-bot bot pushed a commit that referenced this pull request Dec 12, 2018
Revert of #92 

Now that palantir/conjure-java-runtime#827 has merged and we are logging the error name in the exception mapper, we no longer need the injected arg here.

With the injected args, the `ServiceExceptionMapper` logs would have both a `errorName` param and a `throwable0_errorType` param which is confusing and unnecessary.

Also note that this parameter has never been logged properly (see #130), so this does not cause a regression in capability.
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

Successfully merging this pull request may close these issues.

2 participants