diff --git a/command/build/command.go b/command/build/command.go index a878627a5..b0e387c04 100644 --- a/command/build/command.go +++ b/command/build/command.go @@ -188,9 +188,17 @@ func (c Command) Run(env packer.Environment, args []string) int { if len(errors) > 0 { env.Ui().Machine("error-count", strconv.FormatInt(int64(len(errors)), 10)) + env.Ui().Error("\n==> Some builds didn't complete successfully and had errors:") for name, err := range errors { - env.Ui().Machine("error", name, err.Error()) + // Create a UI for the machine readable stuff to be targetted + ui := &packer.TargettedUi{ + Target: name, + Ui: env.Ui(), + } + + ui.Machine("error", err.Error()) + env.Ui().Error(fmt.Sprintf("--> %s: %s", name, err)) } } diff --git a/website/source/docs/machine-readable/command-build.html.markdown b/website/source/docs/machine-readable/command-build.html.markdown index 848d65c90..aac2713f9 100644 --- a/website/source/docs/machine-readable/command-build.html.markdown +++ b/website/source/docs/machine-readable/command-build.html.markdown @@ -147,18 +147,15 @@ of `packer build`.
-- A build error that occurred. + A build error that occurred. The target of this output will be + the build that had the error.
- Data 1: name - The name of the build that had an error. -
- -- Data 2: error - The error message as a string. + Data 1: error - The error message as a string.