Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class RateLimitExceededException extends RuntimeException
public function __construct(
private readonly ?float $retryAfter = null,
) {
parent::__construct('Rate limit exceeded.');
parent::__construct('Rate limit exceeded.', 429);
}

public function getRetryAfter(): ?float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function testRateLimitExceededThrowsException()
$handler = new ResultConverter();

$this->expectException(RateLimitExceededException::class);
$this->expectExceptionCode(429);
$this->expectExceptionMessage('Rate limit exceeded');

try {
Expand All @@ -61,6 +62,7 @@ public function testRateLimitExceededWithoutRetryAfter()
$handler = new ResultConverter();

$this->expectException(RateLimitExceededException::class);
$this->expectExceptionCode(429);
$this->expectExceptionMessage('Rate limit exceeded');

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function testRateLimitExceededThrowsException()
$handler = new ResultConverter();

$this->expectException(RateLimitExceededException::class);
$this->expectExceptionCode(429);
$this->expectExceptionMessage('Rate limit exceeded.');

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function testRateLimitExceededWithRequestsResetTime()
$handler = new ResultConverter();

$this->expectException(RateLimitExceededException::class);
$this->expectExceptionCode(429);
$this->expectExceptionMessage('Rate limit exceeded.');

try {
Expand Down Expand Up @@ -68,6 +69,7 @@ public function testRateLimitExceededWithTokensResetTime()
$handler = new ResultConverter();

$this->expectException(RateLimitExceededException::class);
$this->expectExceptionCode(429);
$this->expectExceptionMessage('Rate limit exceeded.');

try {
Expand Down