provisioner/powershell: fix dropped error

provisioner/powershell: improve error message
This commit is contained in:
Lars Lehtonen 2020-04-08 10:04:08 -07:00
parent 3892e0905a
commit 49f28c9439
No known key found for this signature in database
GPG Key ID: 8137D474EBCB04F2
1 changed files with 4 additions and 1 deletions

View File

@ -44,11 +44,14 @@ func (s *PowershellProvisionerAccTest) GetConfig() (string, error) {
filePath := filepath.Join("./test-fixtures", s.ConfigName)
config, err := os.Open(filePath)
if err != nil {
return "", fmt.Errorf("Expected to find %s", filePath)
return "", fmt.Errorf("os.Open:%v", err)
}
defer config.Close()
file, err := ioutil.ReadAll(config)
if err != nil {
return "", fmt.Errorf("ioutil.ReadAll:%v", err)
}
return string(file), nil
}