Display error message on badly formatted config string array (eg. namepass) (#8910)
* add error when expected string array is not in string array format * add word
This commit is contained in:
parent
7ed98c7e5c
commit
956350db94
|
|
@ -1538,6 +1538,9 @@ func (c *Config) getFieldStringSlice(tbl *ast.Table, fieldName string, target *[
|
||||||
*target = append(*target, str.Value)
|
*target = append(*target, str.Value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
c.addError(tbl, fmt.Errorf("found unexpected format while parsing %q, expecting string array/slice format", fieldName))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1554,6 +1557,9 @@ func (c *Config) getFieldTagFilter(tbl *ast.Table, fieldName string, target *[]m
|
||||||
tagfilter.Filter = append(tagfilter.Filter, str.Value)
|
tagfilter.Filter = append(tagfilter.Filter, str.Value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
c.addError(tbl, fmt.Errorf("found unexpected format while parsing %q, expecting string array/slice format on each entry", fieldName))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
*target = append(*target, tagfilter)
|
*target = append(*target, tagfilter)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue