mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-25 14:16:50 +00:00
28 lines
652 B
PHP
28 lines
652 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace BushlanovDev\MaxMessengerBot\Exceptions;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use RuntimeException;
|
|
use Throwable;
|
|
|
|
class ClientApiException extends RuntimeException
|
|
{
|
|
public function __construct(
|
|
string $message,
|
|
public readonly string $errorCode,
|
|
public readonly ?ResponseInterface $response = null,
|
|
public readonly ?int $httpStatusCode = null,
|
|
?Throwable $previous = null,
|
|
) {
|
|
parent::__construct($message, $httpStatusCode ?? 0, $previous);
|
|
}
|
|
|
|
public function getHttpStatusCode(): ?int
|
|
{
|
|
return $this->httpStatusCode;
|
|
}
|
|
}
|