pub enum DbError {
Show 102 variants
ClaimPending,
NoClaim,
ProviderRequestRunning,
ClaimUnsettled,
ClaimNumberExhausted,
WriteNumberExhausted,
InvalidClaimCoverage,
SequenceGap {
applied: u64,
received: Slot,
},
WriteWaiting(WriteWait),
StateEncoding(Error),
StatePersistence(Arc<DbError>),
RollbackFailed,
CheckpointFailed(Arc<DbError>),
StatisticsFailed(Arc<DbError>),
WallTimer(WallTimerError),
UpkeepThread(Error),
ClaimRead(Error),
StoreClosed,
Shutdown(Shutdown),
Bug(Bug),
StoreFailed(Bug),
Sqlite(Error),
DamagedDatabase,
Invariant {
what: &'static str,
},
StoreSettingsMismatch {
store: StoreId,
},
Schema(SchemaError),
PreparedElsewhere,
DeviceOnlyUnreferenced {
file: FileId,
},
PinChanged {
file: FileId,
},
StepFailed,
StatementFailed,
InternalTable {
table: String,
},
TriggerTarget {
trigger: String,
table: String,
},
SyncedTableInBulkWrite {
table: String,
},
TransactionEnded,
StatementForbidden {
operation: &'static str,
},
WalUnavailable {
mode: String,
},
SqliteSettingOutOfRange {
setting: &'static str,
maximum: u64,
},
ReservedCollation {
name: String,
},
DuplicateCollation {
name: String,
},
ReservedFunction {
name: String,
},
DuplicateFunction {
name: String,
},
ConstantFunction {
name: String,
},
VersionChangeRefused {
name: String,
table: String,
},
VersionNotRebuilt {
name: String,
built: u32,
registered: u32,
},
ClockOutOfRange,
InputBudgetExceeded {
required: u64,
maximum: u64,
},
TooLarge {
field: &'static str,
actual: u64,
maximum: u64,
},
ReferenceAudience {
table: String,
key: RowKey,
column: String,
},
DeletedCircle(CircleId),
NotInCircle(CircleId),
AudienceReloading(Audience),
NotOwner {
table: String,
key: RowKey,
owner: MemberId,
},
InvalidForeignKeyEffect {
table: String,
key: RowKey,
},
KeyNotUuid {
table: String,
key: RowKey,
},
InvalidAudience {
table: String,
key: RowKey,
},
InvalidWrite {
write: WriteId,
error: MergeError,
},
MissingWriteSources(Vec<ChangeId>),
WriteFormat(Error),
MigrationKindMismatch {
version: u32,
},
MigrationReference {
table: String,
column: String,
},
MigrationDuplicateColumn {
table: String,
column: String,
},
MigrationColumnMissing {
table: String,
column: String,
},
MigrationPrimaryKeyMissing {
table: String,
},
MigrationKeyArity {
table: String,
expected: usize,
actual: usize,
},
MigrationTableMissing {
table: String,
},
MigrationReferenceCollision {
table: String,
reference: ForeignKey,
},
DismissedRowChanged {
table: String,
key: RowKey,
},
FileWriteOnce {
table: String,
key: RowKey,
},
UserFileMissing {
path: PathBuf,
},
UserFileChanged {
path: PathBuf,
},
UndeclaredNamespace {
namespace: String,
},
NamespaceKind {
namespace: String,
kind: Provenance,
},
FileNameReused {
name: String,
},
FileUnreferenced {
namespace: String,
file: FileId,
},
FileUnknown {
table: String,
column: String,
file: String,
},
FileAbsent {
file: FileId,
},
NotThisDevice {
file: FileId,
},
NotDeviceOnlyHere {
file: FileId,
},
FileInMove {
file: FileId,
id: MoveId,
},
BoundFileTooLarge {
table: String,
column: String,
size: u64,
limit: u64,
},
DeviceOnly {
file: FileId,
},
MoveUnknown {
id: MoveId,
},
MoveFinished {
id: MoveId,
},
MoveBound {
id: MoveId,
},
NotInCloud {
file: FileId,
},
NoLongerStored {
file: FileId,
},
CopyPathTaken {
path: PathBuf,
},
Disk(FileError),
FileKey(CryptoError),
Lock(StoreLockError),
FileCleanup {
write: Result<(), Box<DbError>>,
failures: Vec<DbError>,
},
StagingCleanup {
operation: Box<DbError>,
cleanup: Box<DbError>,
},
OperationChanged(OperationId),
OperationRunning(OperationId),
OperationUnknown(OperationId),
MemberKeysChanging,
CaptureChanged,
RaiseWaiting,
Snapshot(SnapshotError),
Closing {
failures: Vec<DbError>,
},
Rollback {
operation: Box<DbError>,
rollback: Error,
},
}Expand description
A failed database call or a write the database refuses (§4, §9, §15, §17).
Variants§
ClaimPending
Another claim must settle before this device reserves a new number.
NoClaim
No current claim exists for this operation.
ProviderRequestRunning
A request to a provider account is between its target being fixed and its reply, so a revocation queued now could precede the grants it must follow (§20.9). The call is made again once the request ends.
ClaimUnsettled
Uncertain publication cannot be abandoned or resealed; a landed writes batch cannot finish until its consumed state has committed.
ClaimNumberExhausted
The installation has exhausted its claim-number representation.
WriteNumberExhausted
This installation has exhausted its positive original-write identities.
InvalidClaimCoverage
The supplied floor evidence does not cover the attempted slot.
SequenceGap
Slot application must extend the previously committed prefix.
WriteWaiting(WriteWait)
A slot’s readable original awaits an external prerequisite.
StateEncoding(Error)
A pending record, its subject, the sync status or an operation’s data could not be encoded, or a stored pending record could not be decoded as the requested record type (E5).
StatePersistence(Arc<DbError>)
Saving pending state or the sync status failed. The call that lost the update and every later call and live query fail with this same cause until reopened (E5).
RollbackFailed
An earlier call’s rollback failed, so a connection may still be inside that transaction, holding its uncommitted changes or its old snapshot; this handle, read-only or not, refuses calls until reopened (§4).
CheckpointFailed(Arc<DbError>)
One of coven’s own WAL checkpoints failed with this cause, other than on a busy or locked database, so the store’s checkpointing stopped. Rather than stay open while its WAL grows without bound, this handle and every live query fail with this same cause until reopened (§4).
StatisticsFailed(Arc<DbError>)
Checking or gathering the query planner’s statistics while the store stays open failed with this cause, other than on a busy or locked database, so keeping them stopped. Rather than stay open while the planner plans with statistics that no longer hold, this handle and every live query fail with this same cause until reopened (§4).
WallTimer(WallTimerError)
The handle’s clock could not wait for an open invite’s expiry, so the invite would outlive its lifetime. Rather than stay open without writing expiries, this handle and every live query fail with this same cause until reopened, and opening writes each expiry already past (§13.2).
UpkeepThread(Error)
The system refused a thread of coven’s upkeep, the one that checkpoints a WAL or the one that keeps the planner’s statistics, so the store did not open (§4).
ClaimRead(Error)
Reading a claim’s sealed bytes to retain them failed, and the claim’s transaction did not commit (§11).
StoreClosed
This handle or a clone has closed the store (E1).
Shutdown(Shutdown)
The call’s runtime is shutting down and dropped its work (E15). A
call the blocking pool dropped unstarted changed nothing
(ShutdownOutcome::NotRun); closing, which runs as its own task, may
have closed some connections (ShutdownOutcome::Unknown).
Bug(Bug)
The call’s work panicked: a bug in coven or in the app’s callback, which the caller reports (E15). A write that panicked rolled back, and the bytes it released or staged are removed as after any failed write.
StoreFailed(Bug)
An earlier bug may have left this handle’s state wrong, so the
handle failed with it, and every call and live query fails with it
until the store is reopened (E15). The call whose work hit the bug
returned it as Bug, or the store’s bug sink heard it, so the app
shows this and doesn’t report it again.
Sqlite(Error)
SQLite refused or failed a statement, preserving its error.
DamagedDatabase
A statement met damage SQLite reports (SQLITE_CORRUPT,
SQLITE_NOTADB), decoding stored facts found damage (§19.3), or a
snapshot’s staged records differ from a second staging’s (§19.1).
Invariant
Coven’s own code broke a rule it relies on, such as a caller’s
contract or a step its state machine cannot reach: a bug, not damage.
Sync reports it as Failed(LocalFailure::Bug) (§19.1).
StoreSettingsMismatch
Directory settings disagree with a store’s creation entry (§10).
Schema(SchemaError)
A synced table declaration or schema is invalid.
PreparedElsewhere
A write was given files staged, or a pin prepared, in another open store, or in this one before it closed: the copies they name aren’t reserved here (§17.3, §17.8).
DeviceOnlyUnreferenced
A write made a file device-only and also removed its last reference, so the copy kept as its original would name no file (§17.3). Nothing committed.
PinChanged
A pin prepared over a whole copy already kept found that copy gone when its write committed it, evicted or unpinned since: nothing was pinned, and preparing again downloads it. A prepare whose partial download the app’s unpin ended meanwhile fails with it too (§17.8).
StepFailed
One of coven’s steps in this write failed, and the write’s closure went on to return success: the write rolls back, since a failed step may have made only part of its change (§4).
StatementFailed
One of the app’s statements in this write failed, and the write’s closure went on to return success: the write rolls back, since SQLite may have kept part of the statement’s change or undone rows coven saw it change (§4).
InternalTable
App SQL read, changed or defined one of coven’s internal objects (§4).
TriggerTarget
A local trigger wrote a synced table or a shared trigger a local one (§9.4).
SyncedTableInBulkWrite
A bulk write’s statement, or a trigger or foreign-key action it would run, writes a synced table (§4, E3). Nothing committed.
TransactionEnded
SQLite rolled the owned transaction back itself, so it can’t go on (E3, E13).
StatementForbidden
App SQL tried transaction control, a PRAGMA, ATTACH, loading an extension, changing a hidden rowid, or changing the schema outside a migration (§4, E13).
SQLite kept another journal mode instead of WAL (§4).
SqliteSettingOutOfRange
An app’s SQLite setting is larger than SQLite can hold (api.md E1).
Fields
ReservedCollation
An app collation has the name of one of SQLite’s own (api.md E1).
DuplicateCollation
The app gave two collations one name, which SQLite compares without regard to ASCII case (api.md E1).
ReservedFunction
An app function has the name of one SQLite or coven already has, or coven’s reserved prefix (api.md E1).
DuplicateFunction
The app gave two functions one name, which SQLite compares without regard to ASCII case (api.md E1).
ConstantFunction
An app function is deterministic and takes no arguments, which SQLite evaluates while planning in a way coven can’t receive (api.md E1).
VersionChangeRefused
A writable open found a new version of an app collation or function that a CHECK or generated column uses. Coven rebuilds only indexes, so the open changed nothing (§4).
Fields
VersionNotRebuilt
A read-only open found the store’s indexes built with another version of an app collation or function than the one registered. Only a writable open rebuilds them (§4).
Fields
ClockOutOfRange
The wall clock or next timestamp exceeds its representation (§7.2).
InputBudgetExceeded
Protected remote input fills the configured disk budget. No input or budget change was committed; increase the budget or finish pending work.
Fields
TooLarge
A value or row exceeds the format (format.md D1, D2, D5), or a write’s plaintext and sealing key ids cannot fit in its SQLite queue row (§6.3).
Fields
ReferenceAudience
A reference reaches an audience the source row’s readers cannot read (§15.3).
Fields
DeletedCircle(CircleId)
A write targets a circle whose deletion has been applied (§15.9).
NotInCircle(CircleId)
A local write targets a circle this member is not in or the store does not have (§15).
AudienceReloading(Audience)
This audience still exposes its previous data while its selected boundary reloads (§16.5).
NotOwner
The write directly changed another member’s row of an owner_only()
table: a statement, a shared trigger, or coven copying or dismissing
it for the app (§9.6). The transaction, including its upload record,
did not commit.
Fields
InvalidForeignKeyEffect
The write’s foreign-key actions on this row are not the schema’s exact consequence of its direct changes, so every receiver would refuse them (§9.6). The transaction, including its upload record, did not commit.
KeyNotUuid
An inserted row’s independent key holds no UUID (§9.2).
InvalidAudience
A root row’s audience cell is neither store nor a circle id in
canonical lowercase form (§15).
InvalidWrite
A downloaded write fails the merge’s checks and is never applied (§19.1).
Fields
error: MergeErrorThe merge rule it broke.
MissingWriteSources(Vec<ChangeId>)
Original row-change evidence is unavailable. Receipt waits without consuming the position; local authoring rolls back instead of guessing.
WriteFormat(Error)
A waiting record or its conversion violates the write format (E13).
MigrationKindMismatch
A migration’s declared kind disagrees with its runtime classification.
MigrationReference
A conversion changed or introduced a reference whose generation it cannot know (E13).
Fields
MigrationDuplicateColumn
A converted row names the same column twice.
MigrationColumnMissing
A converted column is absent from the target schema.
MigrationPrimaryKeyMissing
A converted table has no primary index.
MigrationKeyArity
A converted key has the wrong number of values.
Fields
MigrationTableMissing
A converted row or reference names an absent table.
MigrationReferenceCollision
Distinct original references became the same converted reference.
Fields
reference: ForeignKeyThe repeated converted reference.
DismissedRowChanged
A write dismissed a removed row, deleting it for good, and also changed that row or one its delete cascades to (§8.4).
FileWriteOnce
A write changed a write-once file reference that named a file (§17.2).
UserFileMissing
The user’s original disappeared.
UserFileChanged
The user’s original changed during preparation or since it was prepared.
UndeclaredNamespace
No namespace of this name was declared when the store opened (E1).
NamespaceKind
A file was staged into a namespace of the other kind: app bytes into a user namespace, or a user’s original into an app one (§17.1); or a bound reference names a user’s file (§17.4).
Fields
kind: ProvenanceThe kind the namespace was declared with.
FileNameReused
The id source reused the physical name of a kept file: a cache
file’s name, a staged copy’s <folder>/<copy>, or a staging’s folder
(Appendix C.3).
FileUnreferenced
A file the write staged is referenced by none of its rows (§17.2).
FileUnknown
A reference names no file this device has a record of in its row’s audience (§17.2).
Fields
FileAbsent
This device has no record of the file (§17.2): one to move, to make device-only, or to stage a new file over.
NotThisDevice
The file is on another device only, and only that device has its bytes: one to move to the cloud (§17.3), or one a write makes a new file over (§17.2).
NotDeviceOnlyHere
The file to move is in the cloud already (§17.3).
FileInMove
The file to move is in a move already, moving or failed: a file is in one move at a time, and the app cancels a failed one to move its files again (§17.3).
BoundFileTooLarge
A bound reference names a file larger than its limit (§17.4).
Fields
DeviceOnly
A bound reference names a file on one device only that no bound upload stores (§17.4).
MoveUnknown
This device never made the move (§17.3).
MoveFinished
The move finished: its files are in the cloud (§17.3).
MoveBound
The move is a bound file’s: its upload holds a write until the file is stored, so it can’t be cancelled (§17.4).
NotInCloud
The file to make device-only is on one device only already, so storage holds no bytes of it to download (§17.3).
NoLongerStored
No record here names the stored bytes a file reference was taken over any more: the record went, or a switch took it off them, as making the file device-only does. The cache keeps bytes only while a record names them, so a pin fetching them keeps nothing (§17.8).
CopyPathTaken
Another call making files device-only is writing a copy at this path (§17.3).
Disk(FileError)
Reading or keeping file bytes failed.
FileKey(CryptoError)
A write queueing a file’s upload, as staging for the cloud or a move does, could not create the file’s random key (§17.3).
Lock(StoreLockError)
Retaining the store while staging file bytes failed.
FileCleanup
File cleanup failed, retaining every failure: on opening (Ok), or
after a failed write, whose error it keeps (Appendix C.3).
Fields
StagingCleanup
A snapshot load or file check failed, and so did removing the records it staged, which its failure ends (§16.2); both failures are kept, and sync judges the load’s or check’s own as it would alone (§19.1).
Fields
OperationChanged(OperationId)
An operation no longer has the state expected by its caller.
OperationRunning(OperationId)
The operation the app acknowledges is still running: it has no outcome yet (§11.4).
OperationUnknown(OperationId)
coven_operations lists no operation with this id: the app’s writes
never journaled it, or its outcome was acknowledged already (§11.4).
MemberKeysChanging
Self-replacement has paused app writes while queued objects settle and the new binding and custody are installed (§12.3, E9).
CaptureChanged
The prepared raise no longer names the current counted prefix.
RaiseWaiting
An ordinary snapshot of an audience whose raise this device captured and has not published: it would carry a schema version the history doesn’t hold yet (§16.2).
Snapshot(SnapshotError)
Loading plaintext supplied by sync failed without changing the database.
Closing
Closing failed for these connections, after every one was tried (E1).
Rollback
A transaction failed and rolling it back failed too. Later calls fail
with RollbackFailed until the store is reopened (§4).
Implementations§
Trait Implementations§
Source§impl CarriesBug for DbError
impl CarriesBug for DbError
Source§impl Error for DbError
impl Error for DbError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DbError> for BootstrapError
A database call’s or opening’s failure is the store’s.
impl From<DbError> for BootstrapError
A database call’s or opening’s failure is the store’s.
Source§impl From<DbError> for CovenError
impl From<DbError> for CovenError
Source§impl From<DbError> for DeviceOnlyError
impl From<DbError> for DeviceOnlyError
Source§fn from(error: DbError) -> DeviceOnlyError
fn from(error: DbError) -> DeviceOnlyError
Source§impl From<DbError> for FileReadError
impl From<DbError> for FileReadError
Source§fn from(error: DbError) -> FileReadError
fn from(error: DbError) -> FileReadError
Source§impl From<DbError> for ReadOnlyOpenError
A database call’s or opening’s failure is the store’s.
impl From<DbError> for ReadOnlyOpenError
A database call’s or opening’s failure is the store’s.
Source§impl From<ObservationError> for DbError
impl From<ObservationError> for DbError
Source§fn from(error: ObservationError) -> DbError
fn from(error: ObservationError) -> DbError
Source§impl From<SchemaError> for DbError
impl From<SchemaError> for DbError
Source§fn from(source: SchemaError) -> DbError
fn from(source: SchemaError) -> DbError
Source§impl From<SnapshotError> for DbError
impl From<SnapshotError> for DbError
Source§fn from(source: SnapshotError) -> DbError
fn from(source: SnapshotError) -> DbError
Source§impl From<StagingFolderError> for DbError
impl From<StagingFolderError> for DbError
Source§fn from(error: StagingFolderError) -> DbError
fn from(error: StagingFolderError) -> DbError
Source§impl From<StoreLockError> for DbError
impl From<StoreLockError> for DbError
Source§fn from(error: StoreLockError) -> DbError
fn from(error: StoreLockError) -> DbError
Source§impl From<TaskFailed> for DbError
impl From<TaskFailed> for DbError
Source§fn from(failed: TaskFailed) -> DbError
fn from(failed: TaskFailed) -> DbError
Source§impl From<WriterError> for DbError
impl From<WriterError> for DbError
Source§fn from(error: WriterError) -> DbError
fn from(error: WriterError) -> DbError
Auto Trait Implementations§
impl Freeze for DbError
impl !RefUnwindSafe for DbError
impl Send for DbError
impl Sync for DbError
impl Unpin for DbError
impl UnsafeUnpin for DbError
impl !UnwindSafe for DbError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more