Skip to content

Conversation

@pkoenig10
Copy link
Member

@pkoenig10 pkoenig10 commented Sep 28, 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.

@pkoenig10 pkoenig10 requested a review from a team as a code owner September 28, 2018 20:32
* Get Args of this service exception excluding injected/generated Args like errorType.
* @return parameters passed to this ServiceException at construction time
*/
public List<Arg<?>> getParameters() {
Copy link
Contributor

Choose a reason for hiding this comment

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

was this released? is someone using this?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was released, but it is exactly the same as getArgs. But we probably need to keep it to avoid breaks. I'll keep it and mark it as deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

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

not probably, but absolutely.

* Get Args of this service exception excluding injected/generated Args like errorType.
* @return parameters passed to this ServiceException at construction time
*/
public List<Arg<?>> getParameters() {
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a break to remove this, can you deprecate it instead and just have it return args?

isNotNull();

// fetch getParameters here to exclude any generated/injected args like 'errorType'
AssertableArgs actualArgs = new AssertableArgs(actual.getParameters());
Copy link
Contributor

Choose a reason for hiding this comment

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

keep this as it is, or we're going to have issues with mistmatching errors / test-utils versions once again :(


/** A {@link ServiceException} thrown in server-side code to indicate server-side {@link ErrorType error states}. */
public final class ServiceException extends RuntimeException implements SafeLoggable {
public static final String ERROR_TYPE_ARG_NAME = "errorType";
Copy link
Contributor

Choose a reason for hiding this comment

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

also an API break, but I don't think anyone should have relied on this so should be fine (and luckily test-utils didn't rely on it either)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants