providercache: Improve installation error message (#31898)

This commit is contained in:
Radek Simko 2022-09-29 13:37:04 +01:00 committed by GitHub
parent 8c98e1f4a4
commit 196ff4c5c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ func installFromHTTPURL(ctx context.Context, meta getproviders.PackageMeta, targ
f, err := ioutil.TempFile("", "terraform-provider")
if err != nil {
return nil, fmt.Errorf("failed to open temporary file to download from %s", url)
return nil, fmt.Errorf("failed to open temporary file to download from %s: %w", url, err)
}
defer f.Close()
defer os.Remove(f.Name())