From 596a9cc7ffe7455cd6ec2793d5c9a1a832b44f85 Mon Sep 17 00:00:00 2001 From: programmer04 Date: Fri, 15 Mar 2019 23:38:05 +0100 Subject: [PATCH] Improve error message for AWS and Alibaba --- builder/alicloud/ecs/step_pre_validate.go | 2 +- builder/amazon/common/step_pre_validate.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index 57c3546b6..698ed35e5 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -37,7 +37,7 @@ func (s *stepPreValidate) Run(_ context.Context, state multistep.StateBag) multi } if len(images) > 0 { - err := fmt.Errorf("Error: name conflicts with an existing alicloud image: %s", images[0].ImageId) + err := fmt.Errorf("Error: Image Name: '%s' is used by an existing alicloud image: %s", images[0].ImageName, images[0].ImageId) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt diff --git a/builder/amazon/common/step_pre_validate.go b/builder/amazon/common/step_pre_validate.go index f420be990..00bed605d 100644 --- a/builder/amazon/common/step_pre_validate.go +++ b/builder/amazon/common/step_pre_validate.go @@ -90,7 +90,7 @@ func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multi } if len(resp.Images) > 0 { - err := fmt.Errorf("Error: name conflicts with an existing AMI: %s", *resp.Images[0].ImageId) + err := fmt.Errorf("Error: AMI Name: '%s' is used by an existing AMI: %s", *resp.Images[0].Name, *resp.Images[0].ImageId) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt