"""Canonical narrow exceptions for the bucket-event-history domain.:class:`BucketEventValidationError` protects :class:`BucketEvent` and:class:`BucketEventHistoryCatalogue` invariants, while the maintenance errorscover operator-facing bucket browse, export, import, rename, and delete flows."""from__future__importannotationsfrom...core.errors.hierarchyimportCadrumoError,TerminalPreconditionErrorMixin# The application owns the concrete ``PreconditionVerdict`` record. Core's# mixin deliberately carries that value opaquely so this domain taxonomy does# not need a type-only dependency on the application boundary._BucketDeletePreconditionErrorMixin=TerminalPreconditionErrorMixin[object]
[docs]classBucketsError(CadrumoError):"""Base error for the bucket-event-history domain."""
[docs]classBucketEventValidationError(BucketsError):"""Raised when a bucket event fails validation."""
[docs]classBucketMaintenanceError(BucketsError):"""Base error for operator-driven bucket-maintenance operations."""
[docs]classBucketBrowseError(BucketMaintenanceError):"""Raised when a bucket browse / search request cannot be served."""
[docs]classBucketExportError(BucketMaintenanceError):"""Raised when a bucket archive export fails."""
[docs]classBucketImportError(BucketMaintenanceError):"""Raised when a bucket archive import fails (bad payload or collision)."""
[docs]classBucketRenameError(BucketMaintenanceError):"""Raised when a bucket rename violates uniqueness or addressing rules."""
[docs]classBucketDeleteRefusedError(_BucketDeletePreconditionErrorMixin,BucketMaintenanceError):"""Raised when a destructive-action gate refuses a bucket deletion. The bucket-maintenance application boundary may attach a typed terminal precondition verdict when it observes a safety condition with no safe recovery command. The core-owned mixin carries that opaque application record without making this domain taxonomy depend on application models. """
[docs]classBucketArchiveRefusedError(BucketMaintenanceError):"""The refusal reserved for a bucket archive (soft, reversible dormancy). Nothing raises it: the archive service method was deleted when the custody capsule became the sole profile authority, and this is the typed refusal its verb took rather than a guard on a live path. Kept deliberately. The verb's restore-or-retire decision is open, and the orphaned typed contracts around it -- this refusal among them -- are the cheapest specification available to whoever makes it. Deleting them would discard part of the answer before the question is settled. """
[docs]classBucketRestoreRefusedError(BucketMaintenanceError):"""The refusal reserved for restoring an archived bucket (e.g. not archived). Nothing raises it, for the same reason and by the same change as :class:`BucketArchiveRefusedError`: the restore service method was deleted with the archive one, and both refusals were kept as contract rather than retired with their verbs. """