This commit is contained in:
Daniil Gentili 2024-06-30 16:15:51 +02:00
parent 7ad157021a
commit 632da98a33
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@
use Amp\Future\UnhandledFutureError; use Amp\Future\UnhandledFutureError;
use Amp\SignalException; use Amp\SignalException;
use Amp\Sql\SqlException;
use danog\MadelineProto\SecurityException; use danog\MadelineProto\SecurityException;
use Revolt\EventLoop; use Revolt\EventLoop;
use TelegramApiServer\Logger; use TelegramApiServer\Logger;
@ -121,7 +122,7 @@ EventLoop::setErrorHandler(function (\Throwable $e) {
if ($e instanceof UnhandledFutureError) { if ($e instanceof UnhandledFutureError) {
$e = $e->getPrevious(); $e = $e->getPrevious();
} }
if ($e instanceof SecurityException || $e instanceof SignalException) { if ($e instanceof SecurityException || $e instanceof SignalException || $e instanceof SqlException) {
throw $e; throw $e;
} }
if (str_starts_with($e->getMessage(), 'Could not connect to DC ')) { if (str_starts_with($e->getMessage(), 'Could not connect to DC ')) {

View File

@ -14,6 +14,8 @@ use ReflectionProperty;
use RuntimeException; use RuntimeException;
use TelegramApiServer\EventObservers\EventObserver; use TelegramApiServer\EventObservers\EventObserver;
use function Amp\Socket\SocketAddress\fromString;
final class Client final class Client
{ {
public static Client $self; public static Client $self;