fix(parsers.json_v2): Log inner errors (#14296)
This commit is contained in:
parent
004f81651b
commit
a590a1b5b3
|
|
@ -346,6 +346,7 @@ func (p *Parser) expandArray(result MetricNode, timestamp time.Time) ([]telegraf
|
|||
n.ParentIndex = n.Index + result.ParentIndex
|
||||
r, err := p.combineObject(n, timestamp)
|
||||
if err != nil {
|
||||
p.Log.Error(err)
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -366,6 +367,7 @@ func (p *Parser) expandArray(result MetricNode, timestamp time.Time) ([]telegraf
|
|||
n.ParentIndex = n.Index + result.ParentIndex
|
||||
r, err := p.expandArray(n, timestamp)
|
||||
if err != nil {
|
||||
p.Log.Error(err)
|
||||
return false
|
||||
}
|
||||
results = append(results, r...)
|
||||
|
|
@ -586,6 +588,7 @@ func (p *Parser) combineObject(result MetricNode, timestamp time.Time) ([]telegr
|
|||
if val.IsObject() {
|
||||
results, err = p.combineObject(arrayNode, timestamp)
|
||||
if err != nil {
|
||||
p.Log.Error(err)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
|
|
@ -593,6 +596,7 @@ func (p *Parser) combineObject(result MetricNode, timestamp time.Time) ([]telegr
|
|||
arrayNode.ParentIndex -= result.Index
|
||||
r, err := p.expandArray(arrayNode, timestamp)
|
||||
if err != nil {
|
||||
p.Log.Error(err)
|
||||
return false
|
||||
}
|
||||
results = cartesianProduct(r, results)
|
||||
|
|
|
|||
Loading…
Reference in New Issue