fix(inputs.modbus): add slave id to failing connection (#12038)

This commit is contained in:
Mya 2022-10-20 17:24:17 +02:00 committed by GitHub
parent eebe859ce6
commit 716394e55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ func (m *Modbus) Gather(acc telegraf.Accumulator) error {
return fmt.Errorf("disconnecting failed: %w", err)
}
if err := m.connect(); err != nil {
return fmt.Errorf("connecting failed: %w", err)
return fmt.Errorf("slave %d: connecting failed: %w", slaveID, err)
}
}
continue