add AddError method to accumulator (#1536)

This commit is contained in:
Patrick Hemmer
2016-07-25 08:09:49 -04:00
committed by Cameron Sparr
parent 986735234b
commit e68f251df7
5 changed files with 58 additions and 0 deletions

View File

@@ -215,6 +215,9 @@ func (a *Agent) Test() error {
if err := input.Input.Gather(acc); err != nil {
return err
}
if acc.errCount > 0 {
return fmt.Errorf("Errors encountered during processing")
}
// Special instructions for some inputs. cpu, for example, needs to be
// run twice in order to return cpu usage percentages.