Handle error in batteries.go in battery.GetAll(), maybe it is bad idea
This commit is contained in:
@@ -104,9 +104,13 @@ func (c *MyConfig) UpdateBatteryInfo() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// In theory, this module should give for each entry its separate err, but in practice it gives
|
||||
// one single err for all entries, so we cannot detemine whist exatly entry errored.
|
||||
batteries, _ = battery.GetAll()
|
||||
var err error
|
||||
|
||||
batteries, err = battery.GetAll()
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Unable to get battery info: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user