mirror of
https://github.com/kopia/kopia.git
synced 2026-10-22 22:24:49 -04:00
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.
This commit is contained in:
1 parent
62a61e6a0e
commit
883f273579
1 file changed
+1
-1
@@ -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 <key>:<value>")
|
||||
return nil, errors.Errorf("Invalid tag format (%s). Requires <key>:<value>", tagkv)
|
||||
}
|
||||
|
||||
key := tagKeyPrefix + parts[0]
|
||||
|
||||
Reference in new issue
Block a user