-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
FeignException uses request and response but doesn't use a response body #1467
FeignException uses request and response but doesn't use a response body #1467
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I liked the change, but, due to feign nature, we CAN'T just remove public/protected methods/constructors. At least not in minor releases.
Please bring them back, mark as deprecated and we may nuke on feign 12...
private Request request; | ||
|
||
protected FeignException(int status, String message, Throwable cause) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I HATE this class!
That said, it's not safe to remove the extra constructors, as people may be using it.
Bring them back, and feel free to deprecate them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in the commit 2523ef1
* | ||
* @return an Optional wrapping the response body. | ||
*/ | ||
public Optional<ByteBuffer> responseBody() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as with the original constructors... we need to keep the old methods for compatibility.
Please bring them all back, not sure if they got deleted or just sorted, keeping them on their original position makes this more reviewable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in the commit 2523ef1
@@ -271,149 +203,130 @@ static FeignException errorExecuting(Request request, IOException cause) { | |||
} | |||
|
|||
public static class FeignClientException extends FeignException { | |||
public FeignClientException(int status, String message, Request request, byte[] body, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything public, needs to be kept, add @deprected
to them, but keep them in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in the commit 2523ef1
I feel ya |
…ut does not use a response body as byte array
0d53583
to
2c46bb3
Compare
The Snyk upgraded jackson's version in c88b65a and the build was successful. But then I update my branch and it fell for jdk14 only. |
Today I tried to return unit-tests for response body methods. I thought that all these methods should be deprecated. But I found that they are required as a response could have a non-repeatable body so:
|
It requires a different approach, perhaps we need to transfer everything to factory methods. |
Simplifying of FeignException: it uses request and response objects but does not use a response body as byte array.
It is breaking changes if any extension use the methods content. contentUTF8, responseBody or responseHeaders.
FeignException and DecodeException have new constructors.
These changers start from the discussion #1452
P.S.
I like the idea to make FeignException more simplier. But I have not found how to do it without breaking changes.