diff --git a/util/disk/disk_openbsd.go b/util/disk/disk_openbsd.go index 729b071e9e5c..a76664548001 100644 --- a/util/disk/disk_openbsd.go +++ b/util/disk/disk_openbsd.go @@ -5,12 +5,14 @@ package disk import ( "syscall" + + "github.com/pkg/errors" ) func GetDiskStat(root string) (DiskStat, error) { var st syscall.Statfs_t if err := syscall.Statfs(root, &st); err != nil { - return DiskStat{}, err + return DiskStat{}, errors.Wrapf(err, "could not stat fs at %s", root) } return DiskStat{ diff --git a/util/disk/disk_unix.go b/util/disk/disk_unix.go index 37cfeabc1358..00d111142c70 100644 --- a/util/disk/disk_unix.go +++ b/util/disk/disk_unix.go @@ -5,12 +5,14 @@ package disk import ( "syscall" + + "github.com/pkg/errors" ) func GetDiskStat(root string) (DiskStat, error) { var st syscall.Statfs_t if err := syscall.Statfs(root, &st); err != nil { - return DiskStat{}, err + return DiskStat{}, errors.Wrapf(err, "could not stat fs at %s", root) } return DiskStat{ diff --git a/util/disk/disk_windows.go b/util/disk/disk_windows.go index d19df26282ba..7f36e6198824 100644 --- a/util/disk/disk_windows.go +++ b/util/disk/disk_windows.go @@ -4,13 +4,14 @@ package disk import ( + "github.com/pkg/errors" "golang.org/x/sys/windows" ) func GetDiskStat(root string) (DiskStat, error) { rootUTF16, err := windows.UTF16FromString(root) if err != nil { - return DiskStat{}, err + return DiskStat{}, errors.Wrapf(err, "could not encode %s", root) } var ( totalBytes uint64 @@ -22,7 +23,7 @@ func GetDiskStat(root string) (DiskStat, error) { &freeAvailableBytes, &totalBytes, &totalFreeBytes); err != nil { - return DiskStat{}, err + return DiskStat{}, errors.Wrapf(err, "could not stat fs at %s", root) } return DiskStat{