Skip to content

Commit 14986c3

Browse files
authored
override resp status code (#42)
1 parent 991715a commit 14986c3

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
@@ -979,6 +979,7 @@ func (c *Client) doRequest(ctx context.Context, body interface{}, res interface{
979979
// Linear returns 400 when rate limited, so change it to a retryable error
980980
if err != nil && resp != nil && (resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusTooManyRequests) {
981981
l.Debug("rate limiting detected", zap.Int("status_code", resp.StatusCode))
982+
resp.StatusCode = http.StatusTooManyRequests
982983

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

0 commit comments

Comments
 (0)