From f5d040ec31840b1342a1a5073d05eeb0c2af9920 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Wed, 22 Jul 2015 22:38:24 -0400 Subject: [PATCH] Update the error message to be idiomatic Trim trailing newline (since this is likely to show up in a CLI) --- pkg/util/httpstream/spdy/roundtripper.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/util/httpstream/spdy/roundtripper.go b/pkg/util/httpstream/spdy/roundtripper.go index e5954b1712e..c5b3c7d5c51 100644 --- a/pkg/util/httpstream/spdy/roundtripper.go +++ b/pkg/util/httpstream/spdy/roundtripper.go @@ -135,12 +135,13 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec responseError := "" responseErrorBytes, err := ioutil.ReadAll(resp.Body) if err != nil { - responseError = "Unable to read error from server response" + responseError = "unable to read error from server response" } else { responseError = string(responseErrorBytes) + responseError = strings.TrimSpace(responseError) } - return nil, fmt.Errorf("Unable to upgrade connection: %s", responseError) + return nil, fmt.Errorf("unable to upgrade connection: %s", responseError) } return NewClientConnection(s.conn)