Skip to content

Commit 661fccb

Browse files
authored
Fix detection of secondary rate limit
Actual error message is "You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. If you reach out to GitHub Support for help, please include the request ID [...]"
1 parent 67398b0 commit 661fccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Github/HttpClient/Plugin/GithubExceptionThrower.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
128128
}
129129

130130
$reset = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Reset');
131-
if ((403 === $response->getStatusCode()) && 0 < $reset && isset($content['message']) && (0 === strpos($content['message'], 'You have exceeded a secondary rate limit.'))) {
131+
if ((403 === $response->getStatusCode()) && 0 < $reset && isset($content['message']) && (0 === strpos($content['message'], 'You have exceeded a secondary rate limit'))) {
132132
$limit = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Limit');
133133

134134
throw new ApiLimitExceedException($limit, $reset);

0 commit comments

Comments
 (0)