From 0ac538dc31804aa6ea76281b12f832b6fd446d06 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 18 Jun 2013 16:25:35 -0700 Subject: [PATCH] builder/amazonebs: If only one error on destroy, just return it --- builder/amazonebs/artifact.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/amazonebs/artifact.go b/builder/amazonebs/artifact.go index aaaab1891..ae3d44ef4 100644 --- a/builder/amazonebs/artifact.go +++ b/builder/amazonebs/artifact.go @@ -53,7 +53,11 @@ func (a *artifact) Destroy() error { } if len(errors) > 0 { - return &packer.MultiError{errors} + if len(errors) == 1 { + return errors[0] + } else { + return &packer.MultiError{errors} + } } return nil