Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* [CHANGE]
* [FEATURE]
* [ENHANCEMENT]
* [BUGFIX]
* [BUGFIX] Handle no data from powersupplyclass

## 1.0.0 / 2020-05-25

Expand Down
4 changes: 4 additions & 0 deletions collector/powersupplyclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package collector

import (
"fmt"
"os"
"regexp"

"github.com/go-kit/kit/log"
Expand Down Expand Up @@ -54,6 +55,9 @@ func NewPowerSupplyClassCollector(logger log.Logger) (Collector, error) {
func (c *powerSupplyClassCollector) Update(ch chan<- prometheus.Metric) error {
powerSupplyClass, err := getPowerSupplyClassInfo(c.ignoredPattern)
if err != nil {
if os.IsNotExist(err) {
return ErrNoData
}
return fmt.Errorf("could not get power_supply class info: %s", err)
}
for _, powerSupply := range powerSupplyClass {
Expand Down