Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/sphinx/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These errors are triggered from an HTTP response that isn't 2XX:
.. autoclass:: RequestError
.. autoclass:: AuthenticationException
.. autoclass:: AuthorizationException
.. autoclass:: ApiUnavailableException
.. autoclass:: UnsupportedProductError

Transport and Connection Errors
Expand Down
2 changes: 2 additions & 0 deletions elasticsearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from .exceptions import ElasticsearchDeprecationWarning # noqa: F401
from .exceptions import (
ApiError,
ApiUnavailableException,
AuthenticationException,
AuthorizationException,
BadRequestError,
Expand Down Expand Up @@ -74,6 +75,7 @@

__all__ = [
"ApiError",
"ApiUnavailableException",
"AsyncElasticsearch",
"BadRequestError",
"Elasticsearch",
Expand Down
6 changes: 6 additions & 0 deletions elasticsearch/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"NotFoundError",
"ConflictError",
"BadRequestError",
"ApiUnavailableException",
]


Expand Down Expand Up @@ -109,6 +110,10 @@ class AuthorizationException(ApiError):
"""Exception representing a 403 status code."""


class ApiUnavailableException(ApiError):
"""Exception representing a 410 status code."""


class ElasticsearchWarning(TransportWarning):
"""Warning that is raised when a deprecated option
or incorrect usage is flagged via the 'Warning' HTTP header.
Expand All @@ -130,4 +135,5 @@ class GeneralAvailabilityWarning(TransportWarning):
403: AuthorizationException,
404: NotFoundError,
409: ConflictError,
410: ApiUnavailableException,
}
Loading