pub enum Error {
Show 55 variants
TableNotFound {
table: String,
suggestion: Option<String>,
},
ColumnNotFound {
column: String,
table: String,
suggestion: Option<String>,
},
AmbiguousColumn {
column: String,
tables: String,
},
IndexNotFound {
index: String,
table: String,
},
SyntaxError {
message: String,
line: usize,
column: usize,
},
TypeError {
expected: String,
actual: String,
},
UniqueViolation {
table: String,
column: String,
},
PrimaryKeyViolation {
table: String,
},
NotNullViolation {
table: String,
column: String,
},
ForeignKeyViolation {
details: String,
},
CheckViolation {
table: String,
column: String,
constraint: String,
value: String,
},
TransactionConflict,
WriteConflict {
table: String,
},
TransactionEnded,
TransactionTimeout {
transaction_id: u64,
elapsed_ms: u64,
timeout_ms: u64,
},
DeadlockDetected {
cycle: Vec<u64>,
victim: u64,
},
SavepointNotFound {
name: String,
},
TableAlreadyExists {
table: String,
},
IndexAlreadyExists {
index: String,
},
ReadOnly,
DatabaseLocked,
InvalidQuery {
message: String,
},
Query(QueryError),
Unsupported {
feature: String,
},
Config(ConfigError),
CorruptedPage(PageId),
CorruptedWal {
message: String,
},
InvalidPageType {
page_id: PageId,
page_type: u8,
},
PageNotFound(PageId),
DoubleFree(PageId),
BufferPoolFull {
capacity: usize,
pinned: usize,
},
InvalidDatabaseFile {
message: String,
},
VersionMismatch {
file_version: u32,
expected: u32,
},
Internal(String),
Io(Error),
FileNotFound {
path: String,
},
Serialization(String),
CompressionError {
message: String,
},
DecompressionError {
message: String,
expected_size: usize,
},
StorageLimitExceeded {
current_bytes: u64,
limit_bytes: u64,
operation_bytes: u64,
},
WalLimitExceeded {
current_bytes: u64,
limit_bytes: u64,
},
InsufficientDiskSpace {
available_bytes: u64,
required_bytes: u64,
},
AuthenticationFailed {
reason: String,
},
AuthenticationRequired,
ApiKeyNotFound {
key_id: String,
},
ApiKeyExpired {
key_id: String,
},
ApiKeyRevoked {
key_id: String,
},
PermissionDenied {
table: String,
operation: String,
api_key_id: String,
},
SessionNotFound {
session_id: String,
},
SessionExpired {
session_id: String,
inactive_secs: u64,
timeout_secs: u64,
},
SessionClosed {
session_id: String,
},
MaxSessionsExceeded {
max: usize,
},
SessionNotPersistent {
session_id: String,
},
DatabaseClosed,
RecoveryFailed {
message: String,
},
}Expand description
Main error type for FeatherDB operations
Variants§
TableNotFound
Table not found
ColumnNotFound
Column not found in table
AmbiguousColumn
Ambiguous column reference
IndexNotFound
Index not found
SyntaxError
SQL syntax error
TypeError
Type mismatch error
UniqueViolation
Unique constraint violation
PrimaryKeyViolation
Primary key violation
NotNullViolation
Not null constraint violation
ForeignKeyViolation
Foreign key constraint violation
CheckViolation
CHECK constraint violation
TransactionConflict
Transaction conflict (optimistic concurrency)
WriteConflict
Write-write conflict (first-committer-wins)
TransactionEnded
Transaction already committed or aborted
TransactionTimeout
Transaction timeout
DeadlockDetected
Deadlock detected
SavepointNotFound
Savepoint not found
TableAlreadyExists
Table already exists
IndexAlreadyExists
Index already exists
ReadOnly
Database is read-only
DatabaseLocked
Database is locked by another process
InvalidQuery
Invalid SQL query
Query(QueryError)
Rich query error with full context
Unsupported
Unsupported feature
Config(ConfigError)
Configuration error
CorruptedPage(PageId)
Page is corrupted (checksum mismatch or invalid structure)
CorruptedWal
WAL is corrupted
InvalidPageType
Invalid page type
PageNotFound(PageId)
Page not found in buffer pool
DoubleFree(PageId)
Double free error
BufferPoolFull
Buffer pool is full and cannot evict any pages
InvalidDatabaseFile
Invalid database file
VersionMismatch
Database version mismatch
Internal(String)
Internal error (should not happen in production)
Io(Error)
I/O error
FileNotFound
File not found
Serialization(String)
Serialization error
CompressionError
Compression error
DecompressionError
Decompression error
StorageLimitExceeded
Database size limit exceeded
WalLimitExceeded
WAL size limit exceeded
InsufficientDiskSpace
Insufficient disk space
AuthenticationFailed
Authentication failed
AuthenticationRequired
Database requires authentication but no key provided
ApiKeyNotFound
API key not found
ApiKeyExpired
API key has expired
ApiKeyRevoked
API key has been revoked
PermissionDenied
Permission denied for operation on table
SessionNotFound
Session not found
SessionExpired
Session has expired due to inactivity
SessionClosed
Session has been closed
MaxSessionsExceeded
Maximum number of sessions exceeded
SessionNotPersistent
Cannot reopen an ephemeral session
DatabaseClosed
Database has been closed
RecoveryFailed
Recovery failed
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_query(msg: impl Into<String>) -> Self
pub fn invalid_query(msg: impl Into<String>) -> Self
Create a new invalid query error
Sourcepub fn column_not_found(
column: impl Into<String>,
table: impl Into<String>,
suggestion: Option<String>,
) -> Self
pub fn column_not_found( column: impl Into<String>, table: impl Into<String>, suggestion: Option<String>, ) -> Self
Create a column not found error with optional suggestion
Sourcepub fn query_error(
message: impl Into<String>,
sql: impl Into<String>,
line: usize,
column: usize,
) -> Self
pub fn query_error( message: impl Into<String>, sql: impl Into<String>, line: usize, column: usize, ) -> Self
Create a rich query error
Sourcepub fn query_error_with_suggestion(
message: impl Into<String>,
sql: impl Into<String>,
line: usize,
column: usize,
suggestion: impl Into<String>,
) -> Self
pub fn query_error_with_suggestion( message: impl Into<String>, sql: impl Into<String>, line: usize, column: usize, suggestion: impl Into<String>, ) -> Self
Create a query error with suggestion
Sourcepub fn unsupported(feature: impl Into<String>) -> Self
pub fn unsupported(feature: impl Into<String>) -> Self
Create a new unsupported feature error
Sourcepub fn transaction_timeout(
transaction_id: u64,
elapsed_ms: u64,
timeout_ms: u64,
) -> Self
pub fn transaction_timeout( transaction_id: u64, elapsed_ms: u64, timeout_ms: u64, ) -> Self
Create a transaction timeout error
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Check if this error is retriable (e.g., transaction conflict)
Sourcepub fn is_user_error(&self) -> bool
pub fn is_user_error(&self) -> bool
Check if this error is a user error (vs internal/system error)
Sourcepub fn as_query_error(&self) -> Option<&QueryError>
pub fn as_query_error(&self) -> Option<&QueryError>
Try to get the QueryError if this is a query error