Skip to content

Commit

Permalink
Also pass exception for findAvailableConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Scheirlinck committed May 30, 2017
1 parent d8654fb commit b284cf5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Connection/Manager.php
Expand Up @@ -213,10 +213,13 @@ protected function findAvailableConnection()
{
$servers = $this->credentials;
shuffle($servers);
$previous = null;

foreach ($servers as $server) {
try {
$node = $this->getNodeConnection($server);
} catch (ConnectionException $e) {
$previous = $e;
continue;
}

Expand All @@ -225,7 +228,7 @@ protected function findAvailableConnection()
}
}

throw new ConnectionException('No servers available');
throw new ConnectionException('No servers available', 0, $previous);
}

/**
Expand Down

0 comments on commit b284cf5

Please sign in to comment.