Skip to content

Commit

Permalink
wrap errs
Browse files Browse the repository at this point in the history
  • Loading branch information
medyagh committed Aug 10, 2020
1 parent 2580006 commit e0bee98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/minikube/machine/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/docker/machine/libmachine/provision"
"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/mem"
Expand All @@ -47,18 +48,18 @@ func CachedHostInfo() (*HostInfo, []error) {
i, err := cachedCPUInfo()
if err != nil {
glog.Warningf("Unable to get CPU info: %v", err)
hostInfoErrs = append(hostInfoErrs, err)
hostInfoErrs = append(hostInfoErrs, errors.Wrap(err, "cpuInfo"))
}
v, err := cachedSysMemLimit()
if err != nil {
glog.Warningf("Unable to get mem info: %v", err)
hostInfoErrs = append(hostInfoErrs, err)
hostInfoErrs = append(hostInfoErrs, errors.Wrap(err, "memInfo"))
}

d, err := cachedDiskInfo()
if err != nil {
glog.Warningf("Unable to get disk info: %v", err)
hostInfoErrs = append(hostInfoErrs, err)
hostInfoErrs = append(hostInfoErrs, errors.Wrap(err, "diskInfo"))
}

var info HostInfo
Expand Down

0 comments on commit e0bee98

Please sign in to comment.