use AddError everywhere (#2372)

This commit is contained in:
Patrick Hemmer
2017-04-24 14:13:26 -04:00
committed by Daniel Nelson
parent 801f6cb8a0
commit 06baf7cf78
95 changed files with 341 additions and 531 deletions

View File

@@ -52,7 +52,8 @@ func (m *Ipmi) Gather(acc telegraf.Accumulator) error {
for _, server := range m.Servers {
err := m.parse(acc, server)
if err != nil {
return err
acc.AddError(err)
continue
}
}
} else {

View File

@@ -20,7 +20,7 @@ func TestGather(t *testing.T) {
execCommand = fakeExecCommand
var acc testutil.Accumulator
err := i.Gather(&acc)
err := acc.GatherError(i.Gather)
require.NoError(t, err)
@@ -121,7 +121,7 @@ func TestGather(t *testing.T) {
Path: "ipmitool",
}
err = i.Gather(&acc)
err = acc.GatherError(i.Gather)
var testsWithoutServer = []struct {
fields map[string]interface{}