-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Description
The response body would be very useful for debugging error messages for unexpected statuses. Many 4xx and 5xx responses include useful explanations in their body text.
In particular the https://github.com/kubernetes/test-infra repo uses the https://github.com/shurcooL/githubv4 library to interact with GitHub's v4 API and we are seeing lots of 502 and 403 errors that should include explanations in the response bodies.
ref: kubernetes/test-infra#7466
The error is generated here:
Lines 72 to 74 in 3658993
if resp.StatusCode != http.StatusOK { | |
return fmt.Errorf("unexpected status: %v", resp.Status) | |
} |
Adding a best effort
ReadAll
of the response body and appending it to the error text would make this error message much more useful.
I'd be happy to PR this change if this seems reasonable.
Metadata
Metadata
Assignees
Labels
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.