Skip to content

Commit

Permalink
properly handle promise chain in setGateway after logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SQKo committed Apr 14, 2024
1 parent 66cd1f3 commit a8a617d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

/**
Expand Down

0 comments on commit a8a617d

Please sign in to comment.