Merge pull request #15528 from alrs/command-swallowed-errors

Fix swallowed errors in command package.
This commit is contained in:
James Bardin 2017-07-20 08:57:10 -04:00 committed by GitHub
commit 0bca383b6b
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,9 @@ import (
func TestPluginPath(t *testing.T) {
td, err := ioutil.TempDir("", "tf")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(td)
defer testChdir(t, td)()

View File

@ -75,6 +75,10 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
}
states, err := b.States()
if err != nil {
c.Ui.Error(fmt.Sprintf("Failed to get configured named states: %s", err))
return 1
}
for _, s := range states {
if newEnv == s {
c.Ui.Error(fmt.Sprintf(envExists, newEnv))