exceptions

class opensearchpy.AuthenticationException[source]

Bases: TransportError

Exception representing a 401 status code.

class opensearchpy.AuthorizationException[source]

Bases: TransportError

Exception representing a 403 status code.

class opensearchpy.ConflictError[source]

Bases: TransportError

Exception representing a 409 status code.

class opensearchpy.ConnectionError[source]

Bases: TransportError

Error raised when there was an exception while talking to OpenSearch. Original exception from the underlying Connection implementation is available as .info.

__str__()[source]

Return str(self).

Return type:

str

class opensearchpy.ConnectionTimeout[source]

Bases: ConnectionError

A network timeout. Doesn’t cause a node retry by default.

__str__()[source]

Return str(self).

Return type:

str

class opensearchpy.ImproperlyConfigured[source]

Bases: Exception

Exception raised when the config passed to the client is inconsistent or invalid.

class opensearchpy.NotFoundError[source]

Bases: TransportError

Exception representing a 404 status code.

opensearchpy.OpenSearchDeprecationWarning

alias of OpenSearchWarning

class opensearchpy.OpenSearchException[source]

Bases: Exception

Base class for all exceptions raised by this package’s operations (doesn’t apply to ImproperlyConfigured).

class opensearchpy.OpenSearchWarning[source]

Bases: Warning

Warning that is raised when a deprecated option or incorrect usage is flagged via the ‘Warning’ HTTP header.

class opensearchpy.RequestError[source]

Bases: TransportError

Exception representing a 400 status code.

class opensearchpy.SerializationError[source]

Bases: OpenSearchException

Data passed in failed to serialize properly in the Serializer being used.

class opensearchpy.SSLError[source]

Bases: ConnectionError

Error raised when encountering SSL errors.

class opensearchpy.TransportError[source]

Bases: OpenSearchException

Exception raised when OpenSearch returns a non-OK (>=400) HTTP status code. Or when an actual connection error happens; in that case the status_code will be set to 'N/A'.

__str__()[source]

Return str(self).

Return type:

str

property error: str

A string error message.

property info: Dict[str, Any] | Exception | Any

Dict of returned error info from OpenSearch, where available, underlying exception when not.

property status_code: str | int

The HTTP status code of the response that precipitated the error or 'N/A' if not applicable.

class opensearchpy.OpenSearchDslException[source]

Bases: Exception

Base class for all OpenSearchDsl exceptions

class opensearchpy.IllegalOperation[source]

Bases: OpenSearchDslException

Exception representing IllegalOperation

class opensearchpy.UnknownDslObject[source]

Bases: OpenSearchDslException

Exception representing UnknownDSLObject

class opensearchpy.ValidationException[source]

Bases: ValueError, OpenSearchDslException

Exception representing Validation Error