Files
cf7-spam-to-telegram/includes/class-telegram-exception.php
T
2026-04-17 22:39:04 +05:00

28 lines
597 B
PHP

<?php
declare(strict_types=1);
namespace Cf7stg;
final class TelegramException extends \Exception
{
private bool $permanent;
private int $retry_after;
public function __construct(string $message, int $code = 0, bool $permanent = false, int $retry_after = 0)
{
parent::__construct($message, $code);
$this->permanent = $permanent;
$this->retry_after = max(0, $retry_after);
}
public function is_permanent(): bool
{
return $this->permanent;
}
public function retry_after(): int
{
return $this->retry_after;
}
}