Commit bff2e019 authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Merge pull request #11731 from smarterclayton/better_error

Update the error message to be idiomatic
parents 361217e0 f5d040ec
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment