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

Issue #1606 Customize the length of the body in FeignException builder #1767

Merged
merged 3 commits into from Oct 9, 2022

Conversation

coungard
Copy link
Contributor

No description provided.

return errorStatus(methodKey, response, null, null);
}
public static FeignException errorStatus(String methodKey, Response response,
Integer maxBodyBytesLength, Integer maxBodyCharsLength) {
Copy link
Member

Choose a reason for hiding this comment

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

This method is never invoked by feign.

So what would be the point of the change.

I'm sure I'm missing something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@velo it's that issue #1606, need for me, as a feign client.

With these parameters, my exception body will be full information in error decoder handler.

Copy link
Member

Choose a reason for hiding this comment

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

@coungard what I'm not understanding is how.

That new method is never invoked by feign... how is that going to change anything?

Copy link
Contributor Author

@coungard coungard Sep 28, 2022

Choose a reason for hiding this comment

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

@velo if I'm right u mean Default implementation, where errorResponse() used:
изображение

, but i need custom decode() override implementation like this:
изображение
, where i can define body constraints - it's will be very helpfull.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@velo the result can be clearly seen on the test -> FeignExceptionTest::lengthOfBodyExceptionTest (143)

Copy link
Member

Choose a reason for hiding this comment

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

yeah, there is a test that invokes the new code. Where is the code the invokes this?!

As far I can tell, this change change behavior of a test, but no changes on feign behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@velo Sorry, but isn't that enough? The code is called by Feign by default (null, null), but for us it will be overridden parameters:
изображение

Copy link
Member

Choose a reason for hiding this comment

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

ow, I see now, my bad

@coungard coungard requested a review from velo September 26, 2022 14:54
@velo velo merged commit caa3064 into OpenFeign:master Oct 9, 2022
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.

None yet

3 participants