aeat.adapters.persistence.storage.master_key._errors module

Typed exception hierarchy for the master-key cluster.

Each class carries structured payload so callers can render typed diagnostics without re-parsing the message string. Every class inherits from an appropriate base in adapters.persistence.storage and is bound to a declared core.errors.ErrorCode row at import time via the __init_subclass__ hook.

exception MasterKeyReentrantError(provider_name)[source]

Bases: SecretStoreError

Raised when a master-key provider context manager is entered re-entrantly.

The provider is single-entry: a second __enter__ call while an active session is already held is a programming error, not a recoverable runtime state. The caller must close the outer session before re-entering.

Parameters:

provider_name (str)

Return type:

None

code: ClassVar[ErrorCode]
exception MasterKeyTypeError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: StorageError, TypeError

Raised when a master-key operation receives a value of the wrong type.

Inherits from both StorageError and TypeError to remain compatible with callers that catch raw TypeError while allowing the typed storage-error surface to propagate through domain boundaries.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]