From 883f273579cf5b47e1e11bd8efaa7a86b00d703b Mon Sep 17 00:00:00 2001 From: Ali Dowair Date: Mon, 26 Sep 2022 07:37:29 +0300 Subject: [PATCH] Output bad key in error when incorrectly parsed (#2438) In the function that parses the tags passed to the create snapshot command, if the tag had an incorrect format, an error message would be returned which did not show the tag itself, making debugging such error difficult. This commit includes the tag in the error message to make debugging easier. --- cli/command_snapshot_create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/command_snapshot_create.go b/cli/command_snapshot_create.go index 900a029cb..a564dd708 100644 --- a/cli/command_snapshot_create.go +++ b/cli/command_snapshot_create.go @@ -173,7 +173,7 @@ func getTags(tagStrings []string) (map[string]string, error) { for _, tagkv := range tagStrings { parts := strings.SplitN(tagkv, ":", numberOfPartsInTagString) if len(parts) != numberOfPartsInTagString { - return nil, errors.New("Invalid tag format. Requires :") + return nil, errors.Errorf("Invalid tag format (%s). Requires :", tagkv) } key := tagKeyPrefix + parts[0]