Improve error message when CLI wrapper Exec fails

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2023-04-28 08:35:18 +00:00 committed by Brad Davidson
parent bbda54b332
commit 5348b5e696

View File

@ -204,7 +204,10 @@ func stageAndRun(dataDir, cmd string, args []string) error {
logrus.Debugf("Running %s %v", cmd, args)
return syscall.Exec(cmd, args, os.Environ())
if err := syscall.Exec(cmd, args, os.Environ()); err != nil {
return errors.Wrapf(err, "exec %s failed", cmd)
}
return nil
}
// getAssetAndDir returns the name of the bindata asset, along with a directory path