Increase error output
This commit is contained in:
parent
5e1db5e14a
commit
01200ac98b
1 changed files with 2 additions and 2 deletions
|
@ -223,12 +223,12 @@ func read(sensor string) (int64, error) {
|
|||
raw := string(data)
|
||||
|
||||
if !strings.Contains(raw, " YES") {
|
||||
return 0.0, fmt.Errorf("%w: checksum failed", ErrReadSensor)
|
||||
return 0.0, fmt.Errorf("%w: checksum failed [%v]", ErrReadSensor, raw)
|
||||
}
|
||||
|
||||
i := strings.LastIndex(raw, "t=")
|
||||
if i == -1 {
|
||||
return 0.0, fmt.Errorf("%w: t= not found", ErrReadSensor)
|
||||
return 0.0, fmt.Errorf("%w: t= not found in [%v]", ErrReadSensor, raw)
|
||||
}
|
||||
|
||||
c, err := strconv.ParseInt(raw[i+2:len(raw)-1], 10, 64)
|
||||
|
|
Loading…
Reference in a new issue