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

Log explicit response body in case of HTTP errors #91

Closed
hiddewie opened this issue Apr 12, 2021 · 3 comments · Fixed by #92
Closed

Log explicit response body in case of HTTP errors #91

hiddewie opened this issue Apr 12, 2021 · 3 comments · Fixed by #92
Labels
enhancement New feature or request
Milestone

Comments

@hiddewie
Copy link
Contributor

Thanks for the great plugin!

I was running into a configuration error, and the (Gradle) exception message was the following

> Failed to load staging profiles, server at https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ responded with status code 400, body: io.github.gradlenexus.publishplugin.shadow.okhttp3.ResponseBody$1@527c85e2

It would be very nice to see the full response body, because that usually tells more about the problem than a plain object reference.

@szpak szpak added the enhancement New feature or request label Apr 12, 2021
@szpak
Copy link
Contributor

szpak commented Apr 12, 2021

It is somehow tricky with HTTP responses - can be consumed just once. Nevertheless, we don't expect very large responses in our calls (to risk OutOfMemory) and probably in the majority of cases (POSTs) we don't rely on the value, so it should be possible to improve.

Btw, @hiddewie Would you like to give it a shot? ;-)

@hiddewie
Copy link
Contributor Author

Definitely!

The error response can be read in total I think, because it will never be used later, because a RuntimeException is thrown directly after reading the body.

@hiddewie
Copy link
Contributor Author

See linked PR #92

@szpak szpak added this to the 1.1.0 milestone Apr 15, 2021
@szpak szpak closed this as completed in #92 Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants