From 85b2000223b8cd483e1dd5d0ac9db5681fae2b76 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Fri, 13 Sep 2019 07:51:32 -0700 Subject: [PATCH] command/show: Fix dropped errors (#22772) --- command/show.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command/show.go b/command/show.go index bbee8d660..20c918384 100644 --- a/command/show.go +++ b/command/show.go @@ -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.