Return on toml parse errors instead of logging (#7751)
This commit is contained in:
parent
f063ff78f2
commit
cfc1818a5e
|
|
@ -1119,7 +1119,7 @@ func buildAggregator(name string, tbl *ast.Table) (*models.AggregatorConfig, err
|
||||||
var err error
|
var err error
|
||||||
conf.DropOriginal, err = strconv.ParseBool(b.Value)
|
conf.DropOriginal, err = strconv.ParseBool(b.Value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error parsing boolean value for %s: %s\n", name, err)
|
return nil, fmt.Errorf("error parsing boolean value for %s: %s", name, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1161,7 +1161,7 @@ func buildAggregator(name string, tbl *ast.Table) (*models.AggregatorConfig, err
|
||||||
if node, ok := tbl.Fields["tags"]; ok {
|
if node, ok := tbl.Fields["tags"]; ok {
|
||||||
if subtbl, ok := node.(*ast.Table); ok {
|
if subtbl, ok := node.(*ast.Table); ok {
|
||||||
if err := toml.UnmarshalTable(subtbl, conf.Tags); err != nil {
|
if err := toml.UnmarshalTable(subtbl, conf.Tags); err != nil {
|
||||||
log.Printf("Could not parse tags for input %s\n", name)
|
return nil, fmt.Errorf("could not parse tags for input %s", name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1195,7 +1195,7 @@ func buildProcessor(name string, tbl *ast.Table) (*models.ProcessorConfig, error
|
||||||
var err error
|
var err error
|
||||||
conf.Order, err = strconv.ParseInt(b.Value, 10, 64)
|
conf.Order, err = strconv.ParseInt(b.Value, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error parsing int value for %s: %s\n", name, err)
|
return nil, fmt.Errorf("error parsing int value for %s: %s", name, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1410,7 +1410,7 @@ func buildInput(name string, tbl *ast.Table) (*models.InputConfig, error) {
|
||||||
if node, ok := tbl.Fields["tags"]; ok {
|
if node, ok := tbl.Fields["tags"]; ok {
|
||||||
if subtbl, ok := node.(*ast.Table); ok {
|
if subtbl, ok := node.(*ast.Table); ok {
|
||||||
if err := toml.UnmarshalTable(subtbl, cp.Tags); err != nil {
|
if err := toml.UnmarshalTable(subtbl, cp.Tags); err != nil {
|
||||||
log.Printf("E! Could not parse tags for input %s\n", name)
|
return nil, fmt.Errorf("could not parse tags for input %s\n", name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue