azuredol.errors#
Custom exceptions and error-translation decorator for azuredol.
All Azure SDK exception handling for the Mapping-shaped methods on close-to-metal stores
funnels through translate_azure_errors so the auth-error vs not-found distinction
stays auditable from one place. See misc/docs/design_decisions.md §4.
Functions
|
Decorator: translate Azure SDK exceptions into |
Exceptions
Raised on strict-create write attempts when the blob already exists. |
|
Raised when a blob does not exist. |
|
Raised on strict-create attempts when the container already exists. |
|
Raised on |
|
Raised when a container does not exist. |
- exception azuredol.errors.BlobAlreadyExistsError[source]#
Bases:
KeyErrorRaised on strict-create write attempts when the blob already exists.
KeyErrorsubclass for symmetry withBlobNotFoundError— both signal a key-vs-store mismatch.
- exception azuredol.errors.BlobNotFoundError[source]#
Bases:
KeyErrorRaised when a blob does not exist.
KeyErrorsubclass soMappingconsumers work.
- exception azuredol.errors.ContainerAlreadyExistsError[source]#
Bases:
KeyErrorRaised on strict-create attempts when the container already exists.
- exception azuredol.errors.ContainerNotEmptyError[source]#
Bases:
RuntimeErrorRaised on
del account_store[name]when the container has blobs.The user must call
azuredol.delete_container(account_store, name, force=True)to acknowledge the cascading delete. Seemisc/docs/design_decisions.md§12.
- exception azuredol.errors.ContainerNotFoundError[source]#
Bases:
KeyErrorRaised when a container does not exist.
- azuredol.errors.translate_azure_errors(*, key_arg=0, not_found_cls=<class 'azuredol.errors.BlobNotFoundError'>, exists_cls=<class 'azuredol.errors.BlobAlreadyExistsError'>)[source]#
Decorator: translate Azure SDK exceptions into
KeyErrorsubclasses.Auth errors (
ClientAuthenticationError) and all other Azure errors propagate untouched — they are never swallowed as “key absent”. Seemisc/docs/design_decisions.md§4.- Parameters:
key_arg (
int|str) – Position (int) or name (str) of the key argument in the wrapped method’s signature. Used to populateKeyError(key). The receiverselfis at index 0, so the user-facing key is typically at index 1 (the default).not_found_cls (
type[KeyError]) – Exception class to raise onResourceNotFoundError.exists_cls (
type[KeyError]) – Exception class to raise onResourceExistsError.
- Return type: