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

@@ -47,9 +47,7 @@ func (z *Zookeeper) Gather(acc telegraf.Accumulator) error {
}
for _, serverAddress := range z.Servers {
if err := z.gatherServer(serverAddress, acc); err != nil {
return err
}
acc.AddError(z.gatherServer(serverAddress, acc))
}
return nil
}

View File

@@ -19,8 +19,7 @@ func TestZookeeperGeneratesMetrics(t *testing.T) {
var acc testutil.Accumulator
err := z.Gather(&acc)
require.NoError(t, err)
require.NoError(t, acc.GatherError(z.Gather))
intMetrics := []string{
"avg_latency",