Rethrow original exception

This commit is contained in:
Daniil Gentili 2020-02-03 12:52:31 +01:00
parent 1884818465
commit dcd6500737
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 3 additions and 1 deletions

View File

@ -300,7 +300,8 @@ trait Tools
}); });
}); });
} catch (\Throwable $throwable) { } 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)); } while (!$resolved && !(Magic::$signaled && !$ignoreSignal));
if ($exception) { if ($exception) {

View File

@ -50,6 +50,7 @@ trait Login
public function botLogin(string $token): \Generator public function botLogin(string $token): \Generator
{ {
if ($this->authorized === self::LOGGED_IN) { if ($this->authorized === self::LOGGED_IN) {
return;
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE); $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE);
yield from $this->logout(); yield from $this->logout();
} }