This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Exceptions
editExceptions
editClient methods can throw two kinds of exceptions:
-
Requests that were received by the Elasticsearch server but that were rejected
(validation error, server internal timeout exceeded, etc) will produce an
ElasticsearchException
. This exception contains details about the error, provided by Elasticsearch. -
Requests that failed to reach the server (network error, server unavailable,
etc) will produce a
TransportException
. That exception’s cause is the exception thrown by the lower-level implementation. In the case of theRestClientTransport
it will be aResponseException
that contains the low level HTTP response.