Files
jobifygarden/app/Services/JobApi/Exceptions/RateLimitException.php
T
2026-04-03 00:23:01 +03:00

20 lines
489 B
PHP

<?php
namespace App\Services\JobApi\Exceptions;
class RateLimitException extends ApiException
{
public function __construct(
string $apiSource,
public readonly ?int $retryAfter = null,
array $context = []
) {
$message = "Rate limit exceeded for {$apiSource}";
if ($this->retryAfter) {
$message .= ". Retry after {$this->retryAfter} seconds";
}
parent::__construct($message, $apiSource, $context, 429);
}
}