diff --git a/src/danog/MadelineProto/Tools.php b/src/danog/MadelineProto/Tools.php index 45e1575e..644d87de 100644 --- a/src/danog/MadelineProto/Tools.php +++ b/src/danog/MadelineProto/Tools.php @@ -300,7 +300,8 @@ trait Tools }); }); } catch (\Throwable $throwable) { - throw new \Error('Loop exceptionally stopped without resolving the promise', 0, $throwable); + Logger::log('Loop exceptionally stopped without resolving the promise', Logger::FATAL_ERROR); + throw $throwable; } } while (!$resolved && !(Magic::$signaled && !$ignoreSignal)); if ($exception) { diff --git a/src/danog/MadelineProto/Wrappers/Login.php b/src/danog/MadelineProto/Wrappers/Login.php index 114099a1..f6973919 100644 --- a/src/danog/MadelineProto/Wrappers/Login.php +++ b/src/danog/MadelineProto/Wrappers/Login.php @@ -50,6 +50,7 @@ trait Login public function botLogin(string $token): \Generator { if ($this->authorized === self::LOGGED_IN) { + return; $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE); yield from $this->logout(); }