From 01e98bf0dd26a1de7fd280fd4b0f0a79aedd0cdd Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 25 Jul 2013 14:32:46 +0000 Subject: [PATCH] fix errors --- commands.go | 2 +- utils/utils.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/commands.go b/commands.go index 99d91ac771..f0d8f61999 100644 --- a/commands.go +++ b/commands.go @@ -1536,7 +1536,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e } if resp.Header.Get("Content-Type") == "application/json" { - utils.DisplayJSONMessagesStream(resp.Body, out) + return utils.DisplayJSONMessagesStream(resp.Body, out) } else { if _, err := io.Copy(out, resp.Body); err != nil { return err diff --git a/utils/utils.go b/utils/utils.go index 6081935b41..a66319a1ba 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -658,12 +658,14 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer) error { } fmt.Fprintf(out, "%c[%dA", 27, diff) } - jm.Display(out) + err := jm.Display(out) if jm.ID != "" { fmt.Fprintf(out, "%c[%dB", 27, diff) } + if err != nil { + return err + } } -// fmt.Fprintf(out, "\n") return nil }