command/show: Fix dropped errors (#22772)

This commit is contained in:
Lars Lehtonen 2019-09-13 07:51:32 -07:00 committed by Kristin Laemmert
parent 3293f76dc3
commit 85b2000223
1 changed files with 3 additions and 3 deletions

View File

@ -133,8 +133,8 @@ func (c *ShowCommand) Run(args []string) int {
} else {
env := c.Workspace()
stateFile, stateErr = getStateFromEnv(b, env)
if err != nil {
c.Ui.Error(err.Error())
if stateErr != nil {
c.Ui.Error(stateErr.Error())
return 1
}
}
@ -215,7 +215,7 @@ func getPlanFromPath(path string) (*plans.Plan, *statefile.File, error) {
}
stateFile, err := pr.ReadStateFile()
return plan, stateFile, nil
return plan, stateFile, err
}
// getStateFromPath returns a statefile if the user-supplied path points to a statefile.