Add missing error handling
This commit is contained in:
parent
3f9993a9b2
commit
9b3ecbaf0c
|
@ -61,7 +61,15 @@ func (c ChassisCollector) Args() []string {
|
||||||
|
|
||||||
func (c ChassisCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) {
|
func (c ChassisCollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metric, target ipmiTarget) (int, error) {
|
||||||
currentChassisPowerState, err := freeipmi.GetChassisPowerState(result)
|
currentChassisPowerState, err := freeipmi.GetChassisPowerState(result)
|
||||||
|
if err != nil {
|
||||||
|
level.Error(logger).Log("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err)
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
currentChassisDriveFault, err := freeipmi.GetChassisDriveFault(result)
|
currentChassisDriveFault, err := freeipmi.GetChassisDriveFault(result)
|
||||||
|
if err != nil {
|
||||||
|
level.Error(logger).Log("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err)
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
currentChassisCoolingFault, err := freeipmi.GetChassisCoolingFault(result)
|
currentChassisCoolingFault, err := freeipmi.GetChassisCoolingFault(result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
level.Error(logger).Log("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err)
|
level.Error(logger).Log("msg", "Failed to collect chassis data", "target", targetName(target.host), "error", err)
|
||||||
|
|
Loading…
Reference in New Issue