Updated Connections handling (#1127)

* Updated Connections handling

- The ConnectionPool.getConnection method now always returns a connection
- The ConnectionPool.update mehtod now cleans the dead list
- Deprecated the NoLivingConnectionsError

* Updated test

* Updated docs

* The NoLivingConnectionsError can still happen if the filter/selector returns no nodes

* Updated test

* Updated docs

* Catch undefined connections as well

* Updated test

* Updated ApiError type def
This commit is contained in:
Tomas Della Vedova
2020-03-26 13:41:05 +01:00
committed by delvedor
parent 9b400afbc8
commit d84cb382f7
7 changed files with 62 additions and 49 deletions

View File

@ -219,7 +219,7 @@ console.log(errors)
Following you can find the errors exported by the client.
[cols=2*]
|===
|`ElasticsearchClientErrors`
|`ElasticsearchClientError`
|Every error inherits from this class, it is the basic error generated by the client.
|`TimeoutError`
@ -229,7 +229,7 @@ Following you can find the errors exported by the client.
|Generated when an error occurs during the reequest, it can be a connection error or a malformed stream of data.
|`NoLivingConnectionsError`
|Generated in case of all connections present in the connection pool are dead.
|Given the configuration, the ConnectionPool was not able to find a usable Connection for this request.
|`SerializationError`
|Generated if the serialization fails.