pub enum FrankenError {
Show 60 variants
DatabaseNotFound {
path: PathBuf,
},
DatabaseLocked {
path: PathBuf,
},
DatabaseCorrupt {
detail: String,
},
NotADatabase {
path: PathBuf,
},
DatabaseFull,
SchemaChanged,
Io(Error),
IoRead {
page: u32,
},
IoWrite {
page: u32,
},
ShortRead {
expected: usize,
actual: usize,
},
SyntaxError {
token: String,
},
ParseError {
offset: usize,
detail: String,
},
QueryReturnedNoRows,
QueryReturnedMultipleRows,
NoSuchTable {
name: String,
},
NoSuchColumn {
name: String,
},
NoSuchIndex {
name: String,
},
TableExists {
name: String,
},
IndexExists {
name: String,
},
AmbiguousColumn {
name: String,
},
UniqueViolation {
columns: String,
},
NotNullViolation {
column: String,
},
CheckViolation {
name: String,
},
ForeignKeyViolation,
PrimaryKeyViolation,
DatatypeViolation {
column: String,
column_type: String,
actual: String,
},
NestedTransaction,
NoActiveTransaction,
TransactionRolledBack {
reason: String,
},
WriteConflict {
page: u32,
holder: u64,
},
SerializationFailure {
page: u32,
},
SnapshotTooOld {
txn_id: u64,
},
Busy,
BusyRecovery,
BusySnapshot {
conflicting_pages: String,
},
ConcurrentUnavailable,
TypeMismatch {
expected: String,
actual: String,
},
IntegerOverflow,
OutOfRange {
what: String,
value: String,
},
TooBig,
TooManyColumns {
count: usize,
max: usize,
},
SqlTooLong {
length: usize,
max: usize,
},
ExpressionTooDeep {
max: usize,
},
TooManyAttached {
max: usize,
},
TooManyArguments {
name: String,
},
WalCorrupt {
detail: String,
},
CheckpointFailed {
detail: String,
},
LockFailed {
detail: String,
},
CannotOpen {
path: PathBuf,
},
Internal(String),
Unsupported,
NotImplemented(String),
Abort,
AuthDenied,
OutOfMemory,
FunctionError(String),
BackgroundWorkerFailed(String),
ReadOnly,
Interrupt,
VdbeExecutionError {
detail: String,
},
}Expand description
Primary error type for FrankenSQLite operations.
Modeled after SQLite’s error codes with Rust-idiomatic structure. Follows the pattern from beads_rust: structured variants for common cases, recovery hints for user-facing errors.
Variants§
DatabaseNotFound
Database file not found.
DatabaseLocked
Database file is locked by another process.
DatabaseCorrupt
Database file is corrupt.
NotADatabase
Database file is not a valid SQLite database.
DatabaseFull
Database is full (max page count reached).
SchemaChanged
Database schema has changed since the statement was prepared.
Io(Error)
File I/O error.
IoRead
Disk I/O error during database read.
IoWrite
Disk I/O error during database write.
ShortRead
Short read (fewer bytes than expected).
SyntaxError
SQL syntax error.
ParseError
SQL parsing error at a specific position.
QueryReturnedNoRows
Query executed successfully but produced no rows.
QueryReturnedMultipleRows
Query executed successfully but produced more than one row.
NoSuchTable
No such table.
NoSuchColumn
No such column.
NoSuchIndex
No such index.
TableExists
Table already exists.
IndexExists
Index already exists.
AmbiguousColumn
Ambiguous column reference.
UniqueViolation
UNIQUE constraint violation.
NotNullViolation
NOT NULL constraint violation.
CheckViolation
CHECK constraint violation.
ForeignKeyViolation
FOREIGN KEY constraint violation.
PrimaryKeyViolation
PRIMARY KEY constraint violation.
DatatypeViolation
STRICT table datatype constraint violation (SQLITE_CONSTRAINT_DATATYPE).
NestedTransaction
Cannot start a transaction within a transaction.
NoActiveTransaction
No transaction is active.
TransactionRolledBack
Transaction was rolled back due to constraint violation.
WriteConflict
Page-level write conflict (another transaction modified the same page).
SerializationFailure
Serialization failure (first-committer-wins violation).
SnapshotTooOld
Snapshot is too old (required versions have been garbage collected).
Busy
Database is busy (the SQLite classic).
BusyRecovery
Database is busy due to recovery.
BusySnapshot
Concurrent transaction commit failed due to page conflict (SQLITE_BUSY_SNAPSHOT). Another transaction committed changes to pages in the write set since the snapshot was established.
BEGIN CONCURRENT is not available without fsqlite-shm (§5.6.6.2).
TypeMismatch
Type mismatch in column access.
IntegerOverflow
Integer overflow during computation.
OutOfRange
Value out of range.
TooBig
String or BLOB exceeds the size limit.
TooManyColumns
Too many columns.
SqlTooLong
SQL statement too long.
ExpressionTooDeep
Expression tree too deep.
TooManyAttached
Too many attached databases.
TooManyArguments
Too many function arguments.
WalCorrupt
WAL file is corrupt.
CheckpointFailed
WAL checkpoint failed.
LockFailed
File locking failed.
CannotOpen
Cannot open file.
Internal(String)
Internal logic error (should never happen).
Unsupported
Operation is not supported by the current backend or configuration.
NotImplemented(String)
Feature not yet implemented.
Abort
Abort due to callback.
AuthDenied
Authorization denied.
OutOfMemory
Out of memory.
FunctionError(String)
SQL function domain/runtime error (analogous to sqlite3_result_error).
BackgroundWorkerFailed(String)
A background runtime worker failed and poisoned the shared database state.
ReadOnly
Attempt to write a read-only database or virtual table.
Interrupt
Interrupted by a cancellation-aware execution context.
VdbeExecutionError
Execution error within the VDBE bytecode engine.
Implementations§
Source§impl FrankenError
impl FrankenError
Sourcepub const fn error_code(&self) -> ErrorCode
pub const fn error_code(&self) -> ErrorCode
Map this error to a SQLite error code for compatibility.
Sourcepub const fn is_user_recoverable(&self) -> bool
pub const fn is_user_recoverable(&self) -> bool
Whether the user can likely fix this without code changes.
Sourcepub const fn suggestion(&self) -> Option<&'static str>
pub const fn suggestion(&self) -> Option<&'static str>
Human-friendly suggestion for fixing this error.
Sourcepub const fn is_transient(&self) -> bool
pub const fn is_transient(&self) -> bool
Whether this is a transient error that may succeed on retry.
Sourcepub const fn extended_error_code(&self) -> i32
pub const fn extended_error_code(&self) -> i32
Get the extended SQLite error code.
SQLite extended error codes encode additional information in the upper bits:
extended_code = (ext_num << 8) | base_code
For most errors, this returns the base error code. For BUSY variants:
Busy→ 5 (SQLITE_BUSY)BusyRecovery→ 261 (SQLITE_BUSY_RECOVERY = 5 | (1 << 8))BusySnapshot→ 517 (SQLITE_BUSY_SNAPSHOT = 5 | (2 << 8))
Sourcepub fn not_implemented(feature: impl Into<String>) -> Self
pub fn not_implemented(feature: impl Into<String>) -> Self
Create a not-implemented error.
Sourcepub fn function_error(msg: impl Into<String>) -> Self
pub fn function_error(msg: impl Into<String>) -> Self
Create a function domain error.
Trait Implementations§
Source§impl Debug for FrankenError
impl Debug for FrankenError
Source§impl Display for FrankenError
impl Display for FrankenError
Source§impl Error for FrankenError
impl Error for FrankenError
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
use the Display impl or to_string()