mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Update the error message to be idiomatic
Trim trailing newline (since this is likely to show up in a CLI)
This commit is contained in:
parent
d9bb171f8a
commit
f5d040ec31
@ -135,12 +135,13 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec
|
|||||||
responseError := ""
|
responseError := ""
|
||||||
responseErrorBytes, err := ioutil.ReadAll(resp.Body)
|
responseErrorBytes, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
responseError = "Unable to read error from server response"
|
responseError = "unable to read error from server response"
|
||||||
} else {
|
} else {
|
||||||
responseError = string(responseErrorBytes)
|
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)
|
return NewClientConnection(s.conn)
|
||||||
|
Loading…
Reference in New Issue
Block a user