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

internal/getproviders: Add URL to error message for clarity #30810

Merged
merged 2 commits into from Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/getproviders/registry_client.go
Expand Up @@ -437,7 +437,7 @@ func (c *registryClient) getFile(url *url.URL) ([]byte, error) {
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("%s", resp.Status)
return nil, fmt.Errorf("%s returned from %s", resp.Status, resp.Request.Host)
}

data, err := ioutil.ReadAll(resp.Body)
Expand Down Expand Up @@ -478,7 +478,7 @@ func maxRetryErrorHandler(resp *http.Response, err error, numTries int) (*http.R
// both response and error.
var errMsg string
if resp != nil {
errMsg = fmt.Sprintf(": %s returned from %s", resp.Status, resp.Request.URL)
errMsg = fmt.Sprintf(": %s returned from %s", resp.Status, resp.Request.Host)
} else if err != nil {
errMsg = fmt.Sprintf(": %s", err)
}
Expand Down