Skip to content

Commit

Permalink
http agent: Properly wrap buffer reading error
Browse files Browse the repository at this point in the history
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
  • Loading branch information
puerco committed Apr 5, 2024
1 parent 779c891 commit 032dfc1
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 032dfc1

Please sign in to comment.