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;