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/events.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/events.go')
-rw-r--r-- | runsc/cmd/events.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runsc/cmd/events.go b/runsc/cmd/events.go index a54856fb4..208d2f74b 100644 --- a/runsc/cmd/events.go +++ b/runsc/cmd/events.go @@ -76,7 +76,7 @@ func (evs *Events) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa c, err := container.Load(conf.RootDir, id) if err != nil { - Fatalf("error loading sandbox: %v", err) + Fatalf("loading sandbox: %v", err) } // Repeatedly get stats from the container. @@ -84,13 +84,13 @@ func (evs *Events) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa // Get the event and print it as JSON. ev, err := c.Event() if err != nil { - log.Warningf("error getting events for container: %v", err) + log.Warningf("Error getting events for container: %v", err) } // err must be preserved because it is used below when breaking // out of the loop. b, err := json.Marshal(ev) if err != nil { - log.Warningf("error while marshalling event %v: %v", ev, err) + log.Warningf("Error while marshalling event %v: %v", ev, err) } else { os.Stdout.Write(b) } |