mirror of
https://github.com/kopia/kopia.git
synced 2026-05-24 14:44:47 -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:
@@ -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