Skip to content

Commit

Permalink
Improve error message when CLI wrapper Exec fails
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Apr 28, 2023
1 parent bbda54b commit 5348b5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/k3s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5348b5e

Please sign in to comment.