lakefs.exceptions module

Exceptions module

exception lakefs.exceptions.BadRequestException(status=None, reason=None, body=None)[source]

Bases: ServerException

Bad Request

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ConflictException(status=None, reason=None, body=None)[source]

Bases: ServerException

Resource / request conflict

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ForbiddenException(status=None, reason=None, body=None)[source]

Bases: ServerException

Operation not permitted

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ImportManagerException[source]

Bases: LakeFSException

Import manager exceptions that are not originated from the SDK

exception lakefs.exceptions.InvalidRangeException(status=None, reason=None, body=None)[source]

Bases: ServerException, OSError

Raised when the reference could not be found in the lakeFS server

body: dict
reason: str
status_code: int
exception lakefs.exceptions.LakeFSException[source]

Bases: Exception

Base exception for all SDK exceptions

exception lakefs.exceptions.NoAuthenticationFound[source]

Bases: LakeFSException

Raised when no authentication method could be found on Client instantiation

exception lakefs.exceptions.NotAuthorizedException(status=None, reason=None, body=None)[source]

Bases: ServerException

User not authorized to perform operation

body: dict
reason: str
status_code: int
exception lakefs.exceptions.NotFoundException(status=None, reason=None, body=None)[source]

Bases: ServerException

Resource could not be found on lakeFS server

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ObjectExistsException(status=None, reason=None, body=None)[source]

Bases: ServerException, FileExistsError

Raised when Object(’…’).create(mode=’x’) and object exists

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ObjectNotFoundException(status=None, reason=None, body=None)[source]

Bases: NotFoundException, FileNotFoundError

Raised when the currently used object no longer exist in the lakeFS server

body: dict
reason: str
status_code: int
exception lakefs.exceptions.PermissionException(status=None, reason=None, body=None)[source]

Bases: NotAuthorizedException, PermissionError

Raised by Object.open() and Object.create() for compatibility with python

body: dict
reason: str
status_code: int
exception lakefs.exceptions.ServerException(status=None, reason=None, body=None)[source]

Bases: LakeFSException

Generic exception when no other exception is applicable

body: dict
reason: str
status_code: int
exception lakefs.exceptions.TransactionException[source]

Bases: LakeFSException

Exceptions during the transaction commit logic

exception lakefs.exceptions.UnsupportedOperationException(status=None, reason=None, body=None)[source]

Bases: ServerException

Operation not supported by lakeFS server or SDK

body: dict
reason: str
status_code: int
lakefs.exceptions.api_exception_handler(custom_handler=None)[source]

Contexts which converts lakefs_sdk API exceptions to LakeFS exceptions and handles them.

Parameters:

custom_handler (Optional[Callable[[LakeFSException], LakeFSException]]) – Optional handler which can be used to provide custom behavior for specific exceptions. If custom_handler returns an exception, this function will raise the exception at the end of the custom_handler invocation.

lakefs.exceptions.handle_http_error(resp)[source]

Handles http response and raises the appropriate lakeFS exception if needed

Parameters:

resp (HTTPResponse) – The response to parse

Return type:

None