From f9c48c864d6d499d883453a9aebf6adf94033886 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sat, 23 Jan 2016 00:41:36 -0500 Subject: [PATCH] Don't add 'error: ' to messages if already there --- pkg/kubectl/cmd/util/helpers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/kubectl/cmd/util/helpers.go b/pkg/kubectl/cmd/util/helpers.go index 67e3b01c018..890d7d561f7 100644 --- a/pkg/kubectl/cmd/util/helpers.go +++ b/pkg/kubectl/cmd/util/helpers.go @@ -128,7 +128,10 @@ func checkErr(err error, handleErr func(string)) { msg, ok := StandardErrorMessage(err) if !ok { - msg = fmt.Sprintf("error: %s", err.Error()) + msg = err.Error() + if !strings.HasPrefix(msg, "error: ") { + msg = fmt.Sprintf("error: %s", msg) + } } handleErr(msg) }