Skip to content

Commit

Permalink
Catch Throwable instead of Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonneau committed Mar 6, 2022
1 parent 20563df commit 078c9ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function _reconnect(Observable $attempts)
$maxRetries = 150;

return $attempts
->flatMap(function (\Exception $ex) use ($maxRetryDelay, $retryDelayGrowth, $initialRetryDelay) {
->flatMap(function (\Throwable $ex) use ($maxRetryDelay, $retryDelayGrowth, $initialRetryDelay) {
$delay = min($maxRetryDelay, pow($retryDelayGrowth, ++$this->currentRetryCount) + $initialRetryDelay);
$seconds = number_format((float)$delay / 1000, 3, '.', '');
echo 'Error: ', $ex->getMessage(), PHP_EOL, "Reconnecting in ${seconds} seconds...", PHP_EOL;
Expand Down

0 comments on commit 078c9ca

Please sign in to comment.