Exceptions & Warnings
API Errors
These errors are triggered from an HTTP response that isn’t 2XX:
- class elasticsearch.ApiError(message, meta, body, errors=())
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
- property error: str
Backwards-compatible way to access
self.message
- property info: Any
Backwards-compatible way to access
self.body
- property status_code: int
Backwards-compatible way to access
self.meta.status
- class elasticsearch.NotFoundError(message, meta, body, errors=())
Exception representing a 404 status code.
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.ConflictError(message, meta, body, errors=())
Exception representing a 409 status code.
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
- elasticsearch.RequestError
alias of
BadRequestError
- class elasticsearch.AuthenticationException(message, meta, body, errors=())
Exception representing a 401 status code.
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.AuthorizationException(message, meta, body, errors=())
Exception representing a 403 status code.
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.UnsupportedProductError(message, meta, body, errors=())
Error which is raised when the client detects it’s not connected to a supported product.
- Parameters:
message (str)
meta (ApiResponseMeta)
body (Any)
errors (Tuple[Exception, ...])
Transport and Connection Errors
These errors are triggered by an error occurring before an HTTP response arrives:
- class elasticsearch.TransportError(message, errors=())
Generic exception for the ‘elastic-transport’ package.
For the ‘errors’ attribute, errors are ordered from most recently raised (index=0) to least recently raised (index=N)
If an HTTP status code is available with the error it will be stored under ‘status’. If HTTP headers are available they are stored under ‘headers’.
- Parameters:
message (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.SerializationError(message, errors=())
Error that occurred during the serialization or deserialization of an HTTP message body
- Parameters:
message (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.ConnectionError(message, errors=())
Error raised by the HTTP connection
- Parameters:
message (Any)
errors (Tuple[Exception, ...])
- class elasticsearch.ConnectionTimeout(message, errors=())
Connection timed out during an operation
- Parameters:
message (Any)
errors (Tuple[Exception, ...])
- elasticsearch.SSLError
alias of
TlsError
Warnings
- class elasticsearch.ElasticsearchWarning
Warning that is raised when a deprecated option or incorrect usage is flagged via the ‘Warning’ HTTP header.