diff options
Diffstat (limited to 'client/go/cmd/helpers.go')
-rw-r--r-- | client/go/cmd/helpers.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/client/go/cmd/helpers.go b/client/go/cmd/helpers.go index 98d6814d16f..b5525cf11fe 100644 --- a/client/go/cmd/helpers.go +++ b/client/go/cmd/helpers.go @@ -32,16 +32,16 @@ func fatalErr(err error, msg ...interface{}) { func printErrHint(err error, hints ...string) { printErr(nil, err.Error()) for _, hint := range hints { - log.Print(color.Cyan("Hint: "), hint) + fmt.Fprintln(stderr, color.Cyan("Hint:"), hint) } } func printErr(err error, msg ...interface{}) { if len(msg) > 0 { - log.Print(color.Red("Error: "), fmt.Sprint(msg...)) + fmt.Fprintln(stderr, color.Red("Error:"), fmt.Sprint(msg...)) } if err != nil { - log.Print(color.Yellow(err)) + fmt.Fprintln(stderr, color.Yellow(err)) } } @@ -215,11 +215,9 @@ func waitForService(service string, sessionOrRunID int64) { if status/100 == 2 { log.Print(s.Description(), " at ", color.Cyan(s.BaseURL), " is ", color.Green("ready")) } else { - log.Print(s.Description(), " at ", color.Cyan(s.BaseURL), " is ", color.Red("not ready")) if err == nil { - log.Print(color.Yellow(fmt.Sprintf("Status %d", status))) - } else { - log.Print(color.Yellow(err)) + err = fmt.Errorf("Status %d", status) } + fatalErr(err, s.Description(), " at ", color.Cyan(s.BaseURL), " is ", color.Red("not ready")) } } |