Skip to main content

Error

Enum Error 

Source
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

Fields

§table: String
§suggestion: Option<String>
§

ColumnNotFound

Column not found in table

Fields

§column: String
§table: String
§suggestion: Option<String>
§

AmbiguousColumn

Ambiguous column reference

Fields

§column: String
§tables: String
§

IndexNotFound

Index not found

Fields

§index: String
§table: String
§

SyntaxError

SQL syntax error

Fields

§message: String
§line: usize
§column: usize
§

TypeError

Type mismatch error

Fields

§expected: String
§actual: String
§

UniqueViolation

Unique constraint violation

Fields

§table: String
§column: String
§

PrimaryKeyViolation

Primary key violation

Fields

§table: String
§

NotNullViolation

Not null constraint violation

Fields

§table: String
§column: String
§

ForeignKeyViolation

Foreign key constraint violation

Fields

§details: String
§

CheckViolation

CHECK constraint violation

Fields

§table: String
§column: String
§constraint: String
§value: String
§

TransactionConflict

Transaction conflict (optimistic concurrency)

§

WriteConflict

Write-write conflict (first-committer-wins)

Fields

§table: String
§

TransactionEnded

Transaction already committed or aborted

§

TransactionTimeout

Transaction timeout

Fields

§transaction_id: u64
§elapsed_ms: u64
§timeout_ms: u64
§

DeadlockDetected

Deadlock detected

Fields

§cycle: Vec<u64>
§victim: u64
§

SavepointNotFound

Savepoint not found

Fields

§name: String
§

TableAlreadyExists

Table already exists

Fields

§table: String
§

IndexAlreadyExists

Index already exists

Fields

§index: String
§

ReadOnly

Database is read-only

§

DatabaseLocked

Database is locked by another process

§

InvalidQuery

Invalid SQL query

Fields

§message: String
§

Query(QueryError)

Rich query error with full context

§

Unsupported

Unsupported feature

Fields

§feature: String
§

Config(ConfigError)

Configuration error

§

CorruptedPage(PageId)

Page is corrupted (checksum mismatch or invalid structure)

§

CorruptedWal

WAL is corrupted

Fields

§message: String
§

InvalidPageType

Invalid page type

Fields

§page_id: PageId
§page_type: u8
§

PageNotFound(PageId)

Page not found in buffer pool

§

DoubleFree(PageId)

Double free error

§

BufferPoolFull

Buffer pool is full and cannot evict any pages

Fields

§capacity: usize
§pinned: usize
§

InvalidDatabaseFile

Invalid database file

Fields

§message: String
§

VersionMismatch

Database version mismatch

Fields

§file_version: u32
§expected: u32
§

Internal(String)

Internal error (should not happen in production)

§

Io(Error)

I/O error

§

FileNotFound

File not found

Fields

§path: String
§

Serialization(String)

Serialization error

§

CompressionError

Compression error

Fields

§message: String
§

DecompressionError

Decompression error

Fields

§message: String
§expected_size: usize
§

StorageLimitExceeded

Database size limit exceeded

Fields

§current_bytes: u64
§limit_bytes: u64
§operation_bytes: u64
§

WalLimitExceeded

WAL size limit exceeded

Fields

§current_bytes: u64
§limit_bytes: u64
§

InsufficientDiskSpace

Insufficient disk space

Fields

§available_bytes: u64
§required_bytes: u64
§

AuthenticationFailed

Authentication failed

Fields

§reason: String
§

AuthenticationRequired

Database requires authentication but no key provided

§

ApiKeyNotFound

API key not found

Fields

§key_id: String
§

ApiKeyExpired

API key has expired

Fields

§key_id: String
§

ApiKeyRevoked

API key has been revoked

Fields

§key_id: String
§

PermissionDenied

Permission denied for operation on table

Fields

§table: String
§operation: String
§api_key_id: String
§

SessionNotFound

Session not found

Fields

§session_id: String
§

SessionExpired

Session has expired due to inactivity

Fields

§session_id: String
§inactive_secs: u64
§timeout_secs: u64
§

SessionClosed

Session has been closed

Fields

§session_id: String
§

MaxSessionsExceeded

Maximum number of sessions exceeded

Fields

§max: usize
§

SessionNotPersistent

Cannot reopen an ephemeral session

Fields

§session_id: String
§

DatabaseClosed

Database has been closed

§

RecoveryFailed

Recovery failed

Fields

§message: String

Implementations§

Source§

impl Error

Source

pub fn internal(msg: impl Into<String>) -> Self

Create a new internal error

Source

pub fn invalid_query(msg: impl Into<String>) -> Self

Create a new invalid query error

Source

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

Source

pub fn query_error( message: impl Into<String>, sql: impl Into<String>, line: usize, column: usize, ) -> Self

Create a rich query error

Source

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

Source

pub fn unsupported(feature: impl Into<String>) -> Self

Create a new unsupported feature error

Source

pub fn transaction_timeout( transaction_id: u64, elapsed_ms: u64, timeout_ms: u64, ) -> Self

Create a transaction timeout error

Source

pub fn is_retriable(&self) -> bool

Check if this error is retriable (e.g., transaction conflict)

Source

pub fn is_user_error(&self) -> bool

Check if this error is a user error (vs internal/system error)

Source

pub fn as_query_error(&self) -> Option<&QueryError>

Try to get the QueryError if this is a query error

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<ConfigError> for Error

Source§

fn from(source: ConfigError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<QueryError> for Error

Source§

fn from(source: QueryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.