| 1 |
<?php |
| 2 |
|
| 3 |
namespace SyncBasalam\Jobs\Exceptions; |
| 4 |
|
| 5 |
defined('ABSPATH') || exit; |
| 6 |
|
| 7 |
|
| 8 |
class RetryableException extends JobException |
| 9 |
{ |
| 10 |
public function shouldRetry(): bool |
| 11 |
{ |
| 12 |
return true; |
| 13 |
} |
| 14 |
|
| 15 |
public static function apiTimeout(string $message = 'درخواست با تای� |
| 16 |
اوت � |
| 17 |
واجه شد.'): self |
| 18 |
{ |
| 19 |
return new self($message, 408); |
| 20 |
} |
| 21 |
|
| 22 |
public static function networkError(string $message = 'خطای ارتباط شبکه ای'): self |
| 23 |
{ |
| 24 |
return new self($message, 503); |
| 25 |
} |
| 26 |
|
| 27 |
public static function rateLimit(string $message = 'خطای rate limit رخ داد.'): self |
| 28 |
{ |
| 29 |
return new self($message, 429); |
| 30 |
} |
| 31 |
|
| 32 |
public static function serverError(string $message = 'خطای سرور'): self |
| 33 |
{ |
| 34 |
return new self($message, 500); |
| 35 |
} |
| 36 |
|
| 37 |
public static function temporary(string $message = 'خطای � |
| 38 |
وقتی'): self |
| 39 |
{ |
| 40 |
return new self($message, 0); |
| 41 |
} |
| 42 |
} |
| 43 |
|