Source code for aeat.domain.buckets._errors

"""Narrow exceptions for the bucket-event-history domain.

:class:`BucketEventValidationError` protects :class:`BucketEvent` and
:class:`BucketEventHistoryCatalogue` invariants, while the maintenance errors
cover operator-facing bucket browse, export, import, rename, and delete flows.
"""

from __future__ import annotations

from ...core.errors import AeatError


[docs] class BucketsError(AeatError): """Base error for the bucket-event-history domain."""
[docs] class BucketEventValidationError(BucketsError, ValueError): """Raised when a bucket event fails validation."""
[docs] class BucketMaintenanceError(BucketsError): """Base error for operator-driven bucket-maintenance operations."""
[docs] class BucketBrowseError(BucketMaintenanceError): """Raised when a bucket browse / search request cannot be served."""
[docs] class BucketExportError(BucketMaintenanceError): """Raised when a bucket archive export fails."""
[docs] class BucketImportError(BucketMaintenanceError): """Raised when a bucket archive import fails (bad payload or collision)."""
[docs] class BucketRenameError(BucketMaintenanceError): """Raised when a bucket rename violates uniqueness or addressing rules."""
[docs] class BucketDeleteRefusedError(BucketMaintenanceError): """Raised when a bucket delete is refused by a destructive-action gate."""
[docs] class BucketArchiveRefusedError(BucketMaintenanceError): """Raised when a bucket archive (soft, reversible dormancy) is refused."""
[docs] class BucketRestoreRefusedError(BucketMaintenanceError): """Raised when restoring an archived bucket is refused (e.g. not archived)."""