Skip to main content

SqliteError

Enum SqliteError 

Source
pub enum SqliteError {
Show 19 variants Write { stage: SqliteWriteStage, source: Error, }, RequestReadStopped(StorageError), Rusqlite(Error), InvalidData(String), InheritedWriterTransaction, WriterSettlementUnknown, WriteSettlementUnknown { failure: SqliteWriteFailure, }, WriterPoisoned, WriterPoolCheckoutTimeout { timeout: Duration, }, CapacityFloor { volume: String, available_bytes: u64, floor_bytes: u64, required_headroom_bytes: u64, }, CapacityUnavailable { phase: CapacityUnavailablePhase, message: String, }, VolumeLeaseReentry { holder_site: String, requester_site: String, }, WalCeilingOffsetOverflow { bytes: u64, }, WalCeilingUnsupported { bytes: u64, backend_kind: &'static str, }, WalCeilingBelowMinimum { bytes: u64, page_size: u64, minimum_bytes: u64, }, WalCapacityUnavailable { bytes: u64, capability: &'static str, }, InvalidConfig(String), Io(Error), Migration { version: u32, error: String, source: Option<Box<SqliteError>>, },
}
Expand description

Errors produced by the SQLite storage backend.

Variants§

§

Write

Fields

§source: Error
§

RequestReadStopped(StorageError)

A request-scoped read or store acquisition stopped, or read cleanup failed.

§

Rusqlite(Error)

Underlying rusqlite driver error.

§

InvalidData(String)

Data invariant violation (corrupt row, unexpected schema state).

§

InheritedWriterTransaction

A pooled connection contained a transaction from an earlier owner. Its prior side effects cannot be attributed to the new request.

§

WriterSettlementUnknown

The writer could not prove transaction settlement before retirement.

§

WriteSettlementUnknown

Source-free native evidence retained when cleanup cannot prove settlement.

Fields

§

WriterPoisoned

An earlier write on this database could not prove its settlement, so every later write is refused before it starts. Only the write whose settlement failed reports an unknown outcome; this one never ran.

§

WriterPoolCheckoutTimeout

The process-local writer mutex was not acquired within the pool’s configured finite checkout deadline. This stage happens before SQLite executes, so callers must not conflate it with SQLite busy/locked or checkpoint starvation.

The display text intentionally retains the historical InvalidData prefix for compatibility while the variant supplies stable structural classification (ADR-135 F6).

Fields

§timeout: Duration

Pool checkout deadline that elapsed.

§

CapacityFloor

A file-backed writer was refused before SQLite began the operation because the volume’s free space had reached its configured reserve.

Fields

§volume: String
§available_bytes: u64
§floor_bytes: u64
§required_headroom_bytes: u64
§

CapacityUnavailable

A new logical write could not resolve its volume, acquire its lease, or sample available space.

§

VolumeLeaseReentry

The thread asking for a volume’s write lease already holds it, so waiting could never succeed. This is a nested write, not lock contention, and it is refused at once instead of at the deadline.

Fields

§holder_site: String
§requester_site: String
§

WalCeilingOffsetOverflow

A configured WAL ceiling cannot be represented by SQLite’s signed file-offset arithmetic.

Fields

§bytes: u64
§

WalCeilingUnsupported

A WAL ceiling was enabled for a backend that cannot produce a WAL.

Fields

§bytes: u64
§backend_kind: &'static str
§

WalCeilingBelowMinimum

One committed WAL frame cannot fit, even immediately after reset.

Fields

§bytes: u64
§page_size: u64
§minimum_bytes: u64
§

WalCapacityUnavailable

A valid enabled policy cannot run until its WAL I/O limiter exists.

Fields

§bytes: u64
§capability: &'static str
§

InvalidConfig(String)

A PoolConfig value violated a validated invariant at configuration load time (e.g. ADR-131 Decision 2’s write_admission_deadline_ms range). Fires before any connection is opened, and is never silently clamped into range.

§

Io(Error)

Filesystem I/O error.

§

Migration

A versioned migration failed to apply.

Fields

§version: u32

The migration version number that failed.

§error: String

Human-readable description of the failure.

§source: Option<Box<SqliteError>>

The typed cause, when the failure came from an error value. It keeps the native result code and write-stage evidence that error renders as text.

Implementations§

Source§

impl SqliteError

Source

pub fn write(error: Error, stage: SqliteWriteStage) -> Self

Attach a known write boundary while retaining the original native driver error.

Source

pub fn write_failure(&self) -> Option<SqliteWriteFailure>

Source

pub fn migration(version: u32, cause: impl Display + Into<SqliteError>) -> Self

A migration failure that keeps its typed cause.

The message is the cause’s own display text, read before the cause is converted into a SqliteError, so it reads exactly as it did when only the text was kept. A driver error therefore keeps its bare driver text instead of gaining the sqlite error: prefix of its wrapped form.

Source

pub fn migration_with_cause( version: u32, message: impl Into<String>, cause: impl Into<SqliteError>, ) -> Self

A migration failure with a message of its own that still keeps its typed cause.

Source

pub fn migration_message(version: u32, message: impl Into<String>) -> Self

A migration failure that has no underlying error value.

Source

pub fn migration_cause(&self) -> Option<&SqliteError>

The typed cause of a failed migration, when one was kept.

Source

pub fn native_extended_code(&self) -> Option<i32>

The SQLite extended result code behind this error, when it carries one.

Reads only owned shapes (the driver error, the write evidence and a migration’s kept cause) and never calls into source(), for the same reason as native_write_failure.

Source

pub fn wal_capacity_stage(&self) -> Option<&'static str>

Stable structured stage for an ADR-194 WAL-capacity failure.

Source

pub fn into_storage_error( self, capability: StorageCapability, operation: &'static str, ) -> StorageError

Capacity admission is a property of the SQLite file, so its refusals carry StorageCapability::Sql whichever store requested the write. Concrete backend callers use the same mapping as trait implementations: capacity and writer-settlement failures retain their storage taxonomy, and other failures remain typed sources of StorageError::Driver.

Trait Implementations§

Source§

impl Debug for SqliteError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SqliteError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SqliteError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for SqliteError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SqliteError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more