diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-01-18 17:35:09 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-18 17:36:02 -0800 |
commit | c1be25b78d89a3a55a32a7aa10724134eda9813d (patch) | |
tree | bb5c09cb94ab212c158041b260ed0bb480e2a9d5 /runsc/cmd/wait.go | |
parent | c0a981629cf44688687548490c5e665d851afe06 (diff) |
Scrub runsc error messages
Removed "error" and "failed to" prefix that don't add value
from messages. Adjusted a few other messages. In particular,
when the container fail to start, the message returned is easier
for humans to read:
$ docker run --rm --runtime=runsc alpine foobar
docker: Error response from daemon: OCI runtime start failed: <path> did not terminate sucessfully: starting container: starting root container [foobar]: starting sandbox: searching for executable "foobar", cwd: "/", $PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin": no such file or directory
Closes #77
PiperOrigin-RevId: 230022798
Change-Id: I83339017c70dae09e4f9f8e0ea2e554c4d5d5cd1
Diffstat (limited to 'runsc/cmd/wait.go')
-rw-r--r-- | runsc/cmd/wait.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runsc/cmd/wait.go b/runsc/cmd/wait.go index 1e1c1fe17..6498dd15c 100644 --- a/runsc/cmd/wait.go +++ b/runsc/cmd/wait.go @@ -66,7 +66,7 @@ func (wt *Wait) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) } // You can't specify both -pid and -rootpid. if wt.rootPID != unsetPID && wt.pid != unsetPID { - Fatalf("only up to one of -pid and -rootPid can be set") + Fatalf("only one of -pid and -rootPid can be set") } id := f.Arg(0) @@ -74,7 +74,7 @@ func (wt *Wait) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) c, err := container.Load(conf.RootDir, id) if err != nil { - Fatalf("error loading container: %v", err) + Fatalf("loading container: %v", err) } var waitStatus syscall.WaitStatus @@ -83,21 +83,21 @@ func (wt *Wait) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) case wt.rootPID == unsetPID && wt.pid == unsetPID: ws, err := c.Wait() if err != nil { - Fatalf("error waiting on container %q: %v", c.ID, err) + Fatalf("waiting on container %q: %v", c.ID, err) } waitStatus = ws // Wait on a PID in the root PID namespace. case wt.rootPID != unsetPID: ws, err := c.WaitRootPID(int32(wt.rootPID), true /* clearStatus */) if err != nil { - Fatalf("error waiting on PID in root PID namespace %d in container %q: %v", wt.rootPID, c.ID, err) + Fatalf("waiting on PID in root PID namespace %d in container %q: %v", wt.rootPID, c.ID, err) } waitStatus = ws // Wait on a PID in the container's PID namespace. case wt.pid != unsetPID: ws, err := c.WaitPID(int32(wt.pid), true /* clearStatus */) if err != nil { - Fatalf("error waiting on PID %d in container %q: %v", wt.pid, c.ID, err) + Fatalf("waiting on PID %d in container %q: %v", wt.pid, c.ID, err) } waitStatus = ws } @@ -107,7 +107,7 @@ func (wt *Wait) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) } // Write json-encoded wait result directly to stdout. if err := json.NewEncoder(os.Stdout).Encode(result); err != nil { - Fatalf("error marshaling wait result: %v", err) + Fatalf("marshaling wait result: %v", err) } return subcommands.ExitSuccess } |