Fix swallowed errors in command package.

This commit is contained in:
Lars Lehtonen 2017-07-11 08:01:02 -07:00
parent a12daf5aba
commit 8501d83e6c
No known key found for this signature in database
GPG Key ID: 8137D474EBCB04F2
2 changed files with 6 additions and 0 deletions

View File

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

View File

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