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
3 changes: 3 additions & 0 deletions pyiceberg/catalog/rest/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
RESTError,
ServerError,
ServiceUnavailableError,
TooManyRequestsError,
UnauthorizedError,
)
from pyiceberg.typedef import IcebergBaseModel
Expand Down Expand Up @@ -79,6 +80,8 @@ def _handle_non_200_response(exc: HTTPError, error_handler: dict[int, type[Excep
exception = RESTError
elif code == 419:
exception = AuthorizationExpiredError
elif code == 429:
exception = TooManyRequestsError
elif code == 501:
exception = NotImplementedError
elif code == 503:
Expand Down
4 changes: 4 additions & 0 deletions pyiceberg/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class AuthorizationExpiredError(RESTError):
"""When the credentials are expired when performing an action on the REST catalog."""


class TooManyRequestsError(RESTError):
"""Raises when too many requests error is returned by the REST catalog."""


class OAuthError(RESTError):
"""Raises when there is an error with the OAuth call."""

Expand Down