From 632da98a33a62174e3805613934ff1520a2855eb Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 30 Jun 2024 16:15:51 +0200 Subject: [PATCH] Fix --- bootstrap.php | 3 ++- src/Client.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index 3c92ba2..e9837cc 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -2,6 +2,7 @@ use Amp\Future\UnhandledFutureError; use Amp\SignalException; +use Amp\Sql\SqlException; use danog\MadelineProto\SecurityException; use Revolt\EventLoop; use TelegramApiServer\Logger; @@ -121,7 +122,7 @@ EventLoop::setErrorHandler(function (\Throwable $e) { if ($e instanceof UnhandledFutureError) { $e = $e->getPrevious(); } - if ($e instanceof SecurityException || $e instanceof SignalException) { + if ($e instanceof SecurityException || $e instanceof SignalException || $e instanceof SqlException) { throw $e; } if (str_starts_with($e->getMessage(), 'Could not connect to DC ')) { diff --git a/src/Client.php b/src/Client.php index 64b9abd..7a278f0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -14,6 +14,8 @@ use ReflectionProperty; use RuntimeException; use TelegramApiServer\EventObservers\EventObserver; +use function Amp\Socket\SocketAddress\fromString; + final class Client { public static Client $self;