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.SnapshotError[source]

Base class for all django-snapshots exceptions.

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.

exception django_snapshots.SnapshotVersionError[source]

Manifest version is not supported by this release of django-snapshots.

exception django_snapshots.SnapshotEncryptionError[source]

Encryption or decryption failed.

exception django_snapshots.SnapshotConnectorError[source]

Database connector subprocess exited with a non-zero status.