Exceptions

Every CairnDB exception derives from CairnDBError. The two that applications routinely handle, LeaseLost and TransactionConflict, are also exported from the top-level package.

Exception

Raised when

What to do

LeaseLost

a lease write finds the lease fenced, released, or deleted

discard the outcome; someone else owns the work

TransactionConflict

a transaction’s read set was written concurrently

retry the transaction

EventRejectedError

a revalidate hook rejected an event after a lost race

surface it as a business-rule violation

CommitError

a batch could not be committed within max_commit_attempts

retry later; check storage health

ReplayError

a projection handler raised, or there was nothing to snapshot

fix the handler; the projection stays at the previous commit

StorageError

a backend operation failed (other than a lost precondition)

retry; check credentials and connectivity

ConfigurationError

unknown storage type

fix the configuration

Exception hierarchy for CairnDB.

exception cairndb.core.exceptions.CairnDBError[source]

Bases: Exception

Base exception for all CairnDB errors.

exception cairndb.core.exceptions.StorageError[source]

Bases: CairnDBError

Errors related to blob storage operations.

exception cairndb.core.exceptions.SequenceError[source]

Bases: CairnDBError

Errors related to sequence number generation or ordering.

exception cairndb.core.exceptions.ReplayError[source]

Bases: CairnDBError

Errors during WAL replay operations.

exception cairndb.core.exceptions.SchemaVersionError[source]

Bases: CairnDBError

Errors related to schema version mismatches.

exception cairndb.core.exceptions.CommitError[source]

Bases: CairnDBError

Errors during the commit protocol (write path).

exception cairndb.core.exceptions.EventRejectedError[source]

Bases: CommitError

Event rejected by the revalidate hook after a lost commit race.

exception cairndb.core.exceptions.ConfigurationError[source]

Bases: CairnDBError

Errors related to invalid configuration.

exception cairndb.core.exceptions.HandlerNotFoundError[source]

Bases: CairnDBError

Event handler not found for given event type.

exception cairndb.core.exceptions.LeaseLost[source]

Bases: CairnDBError

The lease was fenced: another holder acquired it (epoch advanced).

The former holder must discard any outcome it has not yet written — writes through a lost lease never reach storage.

exception cairndb.core.exceptions.TransactionConflict[source]

Bases: CairnDBError

Optimistic transaction aborted: its read set was written concurrently.