use AddError everywhere (#2372)
This commit is contained in:
committed by
Daniel Nelson
parent
06199523ac
commit
5ebe43f86f
@@ -71,9 +71,8 @@ func (p *Procstat) Gather(acc telegraf.Accumulator) error {
|
||||
|
||||
procs, err := p.updateProcesses(p.procs)
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"E! Error: procstat getting process, exe: [%s] pidfile: [%s] pattern: [%s] user: [%s] %s",
|
||||
p.Exe, p.PidFile, p.Pattern, p.User, err.Error())
|
||||
acc.AddError(fmt.Errorf("E! Error: procstat getting process, exe: [%s] pidfile: [%s] pattern: [%s] user: [%s] %s",
|
||||
p.Exe, p.PidFile, p.Pattern, p.User, err.Error()))
|
||||
}
|
||||
p.procs = procs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user