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
1048 simple illustration - more details in the default feignexception… #1095
1048 simple illustration - more details in the default feignexception… #1095
Conversation
7b41a4d
to
942e453
Compare
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 liked the idea...
Wonder if would be interesting to combine with #1091.
FWIW, looking for a second opinion on 1091
That would also allow to show which method was invoked.
@@ -131,6 +136,11 @@ public static FeignException errorStatus(String methodKey, Response response) { | |||
} catch (IOException ignored) { // NOPMD | |||
} | |||
|
|||
String message = new FeignExceptionMessageBuilder() | |||
.withResponse(response) | |||
.withRequestMethod(response.request().httpMethod()) |
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.
could read the method from the response, eliminating the need to call withRequestMethod
method
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.
fixed
65c61d9
to
e2cb5b8
Compare
e2cb5b8
to
4bf0ea8
Compare
Hi @velo, thanks for feedback. I've polished up the code, and I've abbreviated the response body when it's too long (well, more than 200 chars didn't seem readable to me). I'm not sure about #1091 - give me some time to understand that. Can I have one more question for the future? Quite often, I want to further modify the response body preview. For example - some APIs render 5xx of 4xx pages with HTML. Well, not the perfect world, but I have to live with that. So I need to strip all the HTML to find out, what happened. I'd like to make extracting the response body customisable and injectable, but I can't seem to find a good way with current code (static method of |
ErrorDecoder may be?! |
… message