FeignException includes returned content in message. While this is mostly OK (unless the returned content is very long), the exception could also provide a separate field to obtain the content itself for further parsing instead of having to parse the message for it.
@scythepl this is an enhancement. Let's mark it as such.
@scythepl, are you talking about parsing the response body from content: part of the FeignException message? If so this makes sense because passing the response body and the status upstream is a common and valid use case. Someone consuming the FeignClient shouldn't be handling parsing the feign specific message content. As @kdavisk6 states we can mark this as an enhancement and implement in an upcoming release.
@orwashere yes, that's exactly what I was talking about. Sorry if it wasn't clear. I can't really find an option to mark this issue in any way, maybe it's a permissions thing? I'm not a fluent github issue tracker user, I'm sorry.
The issue is more an enhancement than bug, though I daresay that obligatory inclusion of response content in logs is not a good thing, in some cases it will just be a bad practice (like large messages), in others a security risk (custom backend authentication messages).
Furthermore, getting body by parsing e.getMessage() string doesn't seem like a good practice either.
To sum up, here's what I think would be good:
@scythepl If you feel particularly jazzed about this, why not attempt a PR? Checkout HACKING and experiment.
Hello, @kdavisk6 !
I'm very interested in this issue.
I see that the work on the pull request stopped for some reason. Can I somehow help with this?
Of course. Please read Contributing and Hacking for information on how to contribute.
Ok. @kdavisk6, what should I do - continue with #664(I could create my own PR based on this PR with fixed review comments) or create fully new PR?
Hello @kdavisk6 !
I finished with PR #769.
I'm looking forward to questions and comments.
any idea which version of spring-cloud-openfiegn includes this fix
or how can I include this as separate dependency without impacting spring-cloud-openfeign
This change was merged and release over a year ago. Using the most recent version of Spring Cloud should include this update.
Most helpful comment
@scythepl, are you talking about parsing the response body from content: part of the FeignException message? If so this makes sense because passing the response body and the status upstream is a common and valid use case. Someone consuming the FeignClient shouldn't be handling parsing the feign specific message content. As @kdavisk6 states we can mark this as an enhancement and implement in an upcoming release.