phase 1 and 2
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user