(r *ChunkedResponse) NextResponse() is currently defined by the following code on client.go. The error checking forgets about the original error and then creates another one from the buffer. For timeout errors, this causes that the error message is empty ("").
// NextResponse reads the next line of the stream and returns a response.
func (r *ChunkedResponse) NextResponse() (*Response, error) {
var response Response
if err := r.dec.Decode(&response); err != nil {
if err == io.EOF {
return nil, err
}
// A decoding error happened. This probably means the server crashed
// and sent a last-ditch error message to us. Ensure we have read the
// entirety of the connection to get any remaining error text.
io.Copy(ioutil.Discard, r.duplex)
return nil, errors.New(strings.TrimSpace(r.buf.String()))
}
r.buf.Reset()
return &response, nil
}
(r *ChunkedResponse) NextResponse()
is currently defined by the following code on client.go. The error checking forgets about the original error and then creates another one from the buffer. For timeout errors, this causes that the error message is empty ("").