From fa7b18bc2d24b2898994c88856b0c21247165a17 Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Sat, 21 Jan 2023 17:08:11 +1100 Subject: [PATCH] tweak error messages --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 74085ec..fcfc259 100644 --- a/main.go +++ b/main.go @@ -134,7 +134,7 @@ func readRegs(client modbus.Client, start, qty uint16) error { return fmt.Errorf("read input registers %d-%d: %v", start+1, start+qty, err) } if len(data) != int(2*qty) { - return fmt.Errorf("reading input registers %d-%d: len(data) = %d != %d = 2*qty", start+1, start+qty, len(data), 2*qty) + return fmt.Errorf("read input registers %d-%d: len(data) = %d != %d = 2*qty", start+1, start+qty, len(data), 2*qty) } for addr, reg := range sungrowInputRegs { if addr <= start || addr > start+qty { @@ -146,7 +146,7 @@ func readRegs(client modbus.Client, start, qty uint16) error { log.Printf("Couldn't parse input register data at %d, skipping: %v", addr, err) continue } - return fmt.Errorf("parsing input register data at %d: %v", addr, err) + return fmt.Errorf("parse input register data at %d: %v", addr, err) } //fmt.Printf("%s: %v %s\n", reg.name, val, reg.unit) lastValues[addr] = val