Skip to content

Commit

Permalink
internal/getproviders: Add URL to error message for clarity
Browse files Browse the repository at this point in the history
Occasionally `terraform init` on some providers may return the following error message:

Error while installing citrix/citrixadc v1.13.0: could not query provider
registry for registry.terraform.io/citrix/citrixadc: failed to retrieve
authentication checksums for provider: 403 Forbidden

The 403 is most often returned from GitHub (rather than Registry API)
and this change makes it more obvious.
  • Loading branch information
radeksimko committed Apr 6, 2022
1 parent 3fbedf2 commit 1375b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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.URL)
}

data, err := ioutil.ReadAll(resp.Body)
Expand Down

0 comments on commit 1375b9c

Please sign in to comment.