From a7c279f2031041976eb127736f79b33e138a47fb Mon Sep 17 00:00:00 2001 From: Jeff Zvier Date: Sun, 9 Aug 2020 08:27:43 +0800 Subject: [PATCH] Add more error message for ops when container limit use an device which not exist Signed-off-by: Jeff Zvier --- daemon/daemon_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index d13774fe1a..446c71f3a6 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -187,7 +187,7 @@ func getBlkioWeightDevices(config containertypes.Resources) ([]specs.LinuxWeight for _, weightDevice := range config.BlkioWeightDevice { if err := unix.Stat(weightDevice.Path, &stat); err != nil { - return nil, err + return nil, errors.WithStack(&os.PathError{Op: "stat", Path: weightDevice.Path, Err: err}) } weight := weightDevice.Weight d := specs.LinuxWeightDevice{Weight: &weight} @@ -260,7 +260,7 @@ func getBlkioThrottleDevices(devs []*blkiodev.ThrottleDevice) ([]specs.LinuxThro for _, d := range devs { if err := unix.Stat(d.Path, &stat); err != nil { - return nil, err + return nil, errors.WithStack(&os.PathError{Op: "stat", Path: d.Path, Err: err}) } d := specs.LinuxThrottleDevice{Rate: d.Rate} // the type is 32bit on mips