From ac58773eed4390b0672068f75fefaba73148195b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Sep 2014 11:27:33 -0700 Subject: [PATCH] builder/vmware: better error output from vmrun --- builder/vmware/common/driver.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/vmware/common/driver.go b/builder/vmware/common/driver.go index 29790233c..833cbbbbc 100644 --- a/builder/vmware/common/driver.go +++ b/builder/vmware/common/driver.go @@ -129,7 +129,12 @@ func runAndLog(cmd *exec.Cmd) (string, string, error) { stderrString := strings.TrimSpace(stderr.String()) if _, ok := err.(*exec.ExitError); ok { - err = fmt.Errorf("VMware error: %s", stderrString) + message := stderrString + if message == "" { + message = stdoutString + } + + err = fmt.Errorf("VMware error: %s", message) } log.Printf("stdout: %s", stdoutString)