Skip to content

Commit

Permalink
Merge pull request #102 from puerco/wrap-buffer-err
Browse files Browse the repository at this point in the history
http agent: Properly wrap buffer reading error
  • Loading branch information
k8s-ci-robot authored Apr 5, 2024
2 parents 779c891 + 032dfc1 commit ad24a9c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions http/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package http

import (
"bytes"
"errors"
"fmt"
"io"
"math"
Expand Down Expand Up @@ -214,7 +213,7 @@ func (impl *defaultAgentImplementation) SendGetRequest(client *http.Client, url
func (a *Agent) readResponseToByteArray(response *http.Response) ([]byte, error) {
var b bytes.Buffer
if err := a.readResponse(response, &b); err != nil {
return nil, errors.New("reading")
return nil, fmt.Errorf("reading array buffer: %w", err)
}
return b.Bytes(), nil
}
Expand Down

0 comments on commit ad24a9c

Please sign in to comment.