From a8a617dcc6f55e15dc2ec43d97d7836d3fbaedca Mon Sep 17 00:00:00 2001 From: SQKo <87897282+SQKo@users.noreply.github.com> Date: Mon, 15 Apr 2024 00:00:33 +0700 Subject: [PATCH] properly handle promise chain in setGateway after logging --- src/Discord/Discord.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Discord/Discord.php b/src/Discord/Discord.php index 88fc30e94..e21f99330 100644 --- a/src/Discord/Discord.php +++ b/src/Discord/Discord.php @@ -1351,13 +1351,15 @@ protected function setGateway(?string $gateway = null): ExtendedPromiseInterface $buildParams($gateway); } - $deferred->promise()->then(function ($gateway) { + return $deferred->promise()->then(function ($gateway) { $this->logger->info('gateway retrieved and set', $gateway); + + return $gateway; }, function ($e) { $this->logger->error('error obtaining gateway', ['e' => $e->getMessage()]); - }); - return $deferred->promise(); + return $e; + }); } /**