Repository navigation
Conversation
…xception should be thrown. This allows to react to non-200 statuses not only with an exception but also to return it in the return object.
spencergibb
left a comment
There was a problem hiding this comment.
You have make many changes that are not related to your purpose, please revert them.
| } | ||
|
|
||
| protected IOException logIOException(String configKey, Level logLevel, IOException ioe, long elapsedTime) { | ||
| protected void logIOException(String configKey, Level logLevel, IOException ioe, long elapsedTime) { |
There was a problem hiding this comment.
Why this change? It breaks an API?
There was a problem hiding this comment.
- The return value is unused.
- The method is neither a command nor a query.
There was a problem hiding this comment.
not good enough reasons, as this would break people who are extending this regardless.
a good enough reason is that this method was exposed protected, but not yet released! (unless I'm mistaken) This means that no one would have been able to extend it yet, so we wouldn't be breaking anyone.
| * be asked to decode the response. | ||
| */ | ||
| public Exception decode(String methodKey, Response response); | ||
| Exception decode(String methodKey, Response response); |
There was a problem hiding this comment.
Why change visibility?
There was a problem hiding this comment.
Interface methods are public by default. The 'public' is redundant here. The IDE flagged this.
I will re-add it if the code style guide requires it.
There was a problem hiding this comment.
it is more about making distracting change in the middle of a request, not about some style guide ruling. please be considerate to the time it takes to figure out what is actually needed or not.
| Exception decode(String methodKey, Response response); | ||
|
|
||
| public static class Default implements ErrorDecoder { | ||
| class Default implements ErrorDecoder { |
There was a problem hiding this comment.
Same here. They are also redundant.
| * href="https://tools.ietf.org/html/rfc2616#section-14.37">Retry-After format</a> | ||
| */ | ||
| static class RetryAfterDecoder { | ||
| class RetryAfterDecoder { |
| } | ||
| } | ||
|
|
||
| Object decodeWithDecoder(Response response) throws Throwable { |
There was a problem hiding this comment.
So that is nearer to the one-and-only caller.
There was a problem hiding this comment.
changes like this make it hard to see what actual change is intended. This is far more important than what is visually appealing to any of us. In other words, please try not to move things around for the sake of moving them. It makes it much harder for us to figure out what might accidentally become broken.
| // ensure the request is set. TODO: remove in Feign 10 | ||
| response.toBuilder().request(request).build(); | ||
| } | ||
| return decodeResponse(response); |
There was a problem hiding this comment.
Moving this to another method just makes it harder to see what you are actually changing.
There was a problem hiding this comment.
The old method was already big. Too big for my taste. Even the new decodeResponse() is on the upper limit for my taste.
|
Just tell me which changes should be reverted and I will do so. |
| public void decoderCanThrowUnwrappedExceptionInDecode404Mode() throws Exception { | ||
| server.enqueue(new MockResponse().setResponseCode(404)); | ||
| thrown.expect(NoSuchElementException.class); | ||
| thrown.expectCause(isA(NoSuchElementException.class)); |
codefromthecrypt
left a comment
There was a problem hiding this comment.
Please revert everything style related as well everything that arbitrarily moves or refactors methods. Then, add a test to show that what situation you described works. At the moment, this is mostly distracting code.
... exception should be thrown. This allows to react to non-200 statuses not only with an
exception but also to return it in the return object.