Skip to content

Commit 9fa619e

Browse files
committed
override resp status code
1 parent bd7a204 commit 9fa619e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/linear/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ func (c *Client) doRequest(ctx context.Context, body interface{}, res interface{
976976
// Linear returns 400 when rate limited, so change it to a retryable error
977977
if err != nil && resp != nil && (resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusTooManyRequests) {
978978
l.Debug("rate limiting detected", zap.Int("status_code", resp.StatusCode))
979+
resp.StatusCode = http.StatusTooManyRequests
979980

980981
rlData.Status = v2.RateLimitDescription_STATUS_OVERLIMIT
981982
return resp, rlData, uhttp.WrapErrorsWithRateLimitInfo(codes.Unavailable, resp, err)

0 commit comments

Comments
 (0)