Exceptions¶
All django-snapshots exceptions inherit from SnapshotError
so you can catch the entire family with a single except clause:
from django_snapshots import SnapshotError
try:
snapshot = Snapshot.from_storage(storage, name)
except SnapshotError as exc:
logger.error("Snapshot operation failed: %s", exc)
Exception hierarchy:
SnapshotError
├── SnapshotStorageCapabilityError
├── SnapshotExistsError
├── SnapshotNotFoundError
├── SnapshotIntegrityError
├── SnapshotVersionError
├── SnapshotEncryptionError
└── SnapshotConnectorError
- exception django_snapshots.SnapshotStorageCapabilityError[source]¶
Storage backend does not support the requested operation.
Raised when a feature requires AdvancedSnapshotStorage but the configured backend only satisfies SnapshotStorage.
- exception django_snapshots.SnapshotExistsError[source]¶
A snapshot with this name already exists in storage.
Pass –overwrite to replace it.
- exception django_snapshots.SnapshotNotFoundError[source]¶
No snapshot with this name exists in storage.
- exception django_snapshots.SnapshotIntegrityError[source]¶
Checksum or signature verification failed.
Raised during import when an artifact’s SHA-256 checksum does not match the value recorded in the manifest.