Skip to content

Commit ffe0510

Browse files
josephtaylor-mnpolyfractal
authored andcommitted
Catch additional exceptions in the ping function for those who use multiple nodes in their connection pool.
We were running into these errors throughout different stages of upgrading our Elasticsearch server.
1 parent 46f7f36 commit ffe0510

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Elasticsearch/Client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Elasticsearch\Common\Exceptions\BadMethodCallException;
66
use Elasticsearch\Common\Exceptions\InvalidArgumentException;
7+
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
8+
use Elasticsearch\Common\Exceptions\BadRequest400Exception;
79
use Elasticsearch\Common\Exceptions\Missing404Exception;
810
use Elasticsearch\Common\Exceptions\TransportException;
911
use Elasticsearch\Endpoints\AbstractEndpoint;
@@ -136,6 +138,8 @@ public function ping($params = [])
136138
return false;
137139
} catch (TransportException $exception) {
138140
return false;
141+
} catch (NoNodesAvailableException $exception) {
142+
return false;
139143
}
140144

141145
return true;

0 commit comments

Comments
 (0)