Skip to content

Commit 89adb94

Browse files
committed
libgv/request: fix handling http connection errors
1 parent 639269e commit 89adb94

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/libgv/request.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (c *Client) makeRequestDirect(ctx context.Context, method string, parsedAdd
229229
return req, resp, nil
230230
}
231231

232-
func (c *Client) logRequestFail(ctx context.Context, addr *url.URL, req *http.Request, resp *http.Response, err error, retryCount int, retryIn time.Duration) *ResponseError {
232+
func (c *Client) logRequestFail(ctx context.Context, addr *url.URL, req *http.Request, resp *http.Response, err error, retryCount int, retryIn time.Duration) error {
233233
logEvt := zerolog.Ctx(ctx).Warn().
234234
Stringer("request_url", addr).
235235
Int("retry_count", retryCount)
@@ -256,6 +256,9 @@ func (c *Client) logRequestFail(ctx context.Context, addr *url.URL, req *http.Re
256256
} else {
257257
logEvt.Msg("Request failed, not retrying")
258258
}
259+
if err != nil {
260+
return err
261+
}
259262
return &ResponseError{
260263
Req: req,
261264
Resp: resp,

0 commit comments

Comments
 (0)