Skip to content

Commit 45144d2

Browse files
committed
fixing a problem I made
1 parent 1405fe7 commit 45144d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

httpclient/request.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (c *Client) DoRequest(method, endpoint string, body, out interface{}) (*htt
7070
}
7171

7272
if IsIdempotentHTTPMethod(method) {
73-
return c.requestWithRetries(method, endpoint, body)
73+
return c.requestWithRetries(method, endpoint, body, out)
7474
} else if !IsIdempotentHTTPMethod(method) {
7575
return c.request(method, endpoint, body, out)
7676
} else {
@@ -112,7 +112,7 @@ func (c *Client) DoRequest(method, endpoint string, body, out interface{}) (*htt
112112
// operations.
113113
// - The retry mechanism employs exponential backoff with jitter to mitigate the impact of retries on the server.
114114
// endregion
115-
func (c *Client) requestWithRetries(method, endpoint string, body interface{}) (*http.Response, error) {
115+
func (c *Client) requestWithRetries(method, endpoint string, body, out interface{}) (*http.Response, error) {
116116
var resp *http.Response
117117
var err error
118118
var retryCount int
@@ -139,7 +139,7 @@ func (c *Client) requestWithRetries(method, endpoint string, body interface{}) (
139139
c.Sugar.Warn("Redirect response received", zap.Int("status_code", resp.StatusCode), zap.String("location", resp.Header.Get("Location")))
140140
}
141141
c.Sugar.Infof("%s request successful at %v", resp.Request.Method, resp.Request.URL)
142-
return resp, nil
142+
return resp, response.HandleAPISuccessResponse(resp, out, c.Sugar)
143143
}
144144

145145
// Message
@@ -243,7 +243,7 @@ func (c *Client) request(method, endpoint string, body, out interface{}) (*http.
243243
c.Sugar.Warn("Redirect response received", zap.Int("status_code", resp.StatusCode), zap.String("location", resp.Header.Get("Location")))
244244
}
245245
c.Sugar.Infof("%s request successful at %v", resp.Request.Method, resp.Request.URL)
246-
return resp, nil
246+
return resp, response.HandleAPISuccessResponse(resp, out, c.Sugar)
247247
}
248248

249249
return nil, response.HandleAPIErrorResponse(resp, c.Sugar)

0 commit comments

Comments
 (0)