pub enum Error {
Show 60 variants
TableNotFound,
TableAlreadyExists,
TableClosed,
TableColumnsNotMatch {
expected: usize,
got: usize,
},
ColumnNotFound,
ColumnNotFoundByName {
name: String,
},
InvalidColumnType,
DuplicateColumn,
InvalidValue,
InvalidArgument {
message: String,
},
ValueTooLong {
column: String,
max: usize,
got: usize,
},
NotNullConstraint {
column: String,
},
PrimaryKeyConstraint {
row_id: i64,
},
UniqueConstraint {
index: String,
column: String,
value: String,
},
CheckConstraintViolation {
column: String,
expression: String,
},
TransactionNotStarted,
TransactionAlreadyStarted,
TransactionEnded,
TransactionAborted,
TransactionCommitted,
TransactionClosed,
IndexNotFound,
IndexAlreadyExists,
IndexAlreadyExistsByName(String),
IndexNotFoundByName(String),
IndexColumnNotFound,
IndexClosed,
EngineNotOpen,
EngineAlreadyOpen,
ViewAlreadyExists(String),
ViewNotFound(String),
LockAcquisitionFailed(String),
NoRowsReturned,
NoStatementsToExecute,
ColumnIndexOutOfBounds {
index: usize,
},
WalNotRunning,
WalFileClosed,
WalNotInitialized,
DatabaseLocked,
CannotDropPrimaryKey,
NullComparison,
IncomparableTypes,
NotSupported,
SegmentNotFound,
ExpressionEvaluation,
ExpressionEvaluationWithMessage {
message: String,
},
TypeConversion {
from: String,
to: String,
},
Parse {
message: String,
},
Io {
message: String,
},
Internal {
message: String,
},
TableExists(String),
TableNotFoundByName(String),
TableOrViewNotFound(String),
ColumnNotFoundNamed(String),
Type(String),
DivisionByZero,
QueryCancelled,
NotSupportedMessage(String),
ParseError(String),
InvalidArgumentMessage(String),
}Expand description
Main error type for Stoolap storage operations
This enum covers all error cases including both sentinel errors and structured errors with context.
Variants§
TableNotFound
Table not found in the database
TableAlreadyExists
Table already exists when trying to create
TableClosed
Table has been closed and cannot be used
TableColumnsNotMatch
Table column count mismatch
ColumnNotFound
Column not found in table schema
ColumnNotFoundByName
Column not found by name (with name context)
InvalidColumnType
Invalid column type for operation
DuplicateColumn
Duplicate column name in schema
InvalidValue
Invalid value for operation
InvalidArgument
Invalid argument for function
ValueTooLong
Value exceeds maximum length
NotNullConstraint
NOT NULL constraint violation
PrimaryKeyConstraint
Primary key constraint violation
UniqueConstraint
Unique constraint violation
CheckConstraintViolation
CHECK constraint violation
TransactionNotStarted
Transaction has not been started
TransactionAlreadyStarted
Transaction has already been started
TransactionEnded
Transaction has already ended (committed or rolled back)
TransactionAborted
Transaction was aborted
TransactionCommitted
Transaction has already been committed
TransactionClosed
Transaction has been closed
IndexNotFound
Index not found
IndexAlreadyExists
Index already exists
IndexAlreadyExistsByName(String)
Index already exists (with name)
IndexNotFoundByName(String)
Index not found (with name)
IndexColumnNotFound
Column for index not found
IndexClosed
Index is closed
EngineNotOpen
Engine is not open
EngineAlreadyOpen
Engine is already open
ViewAlreadyExists(String)
View already exists
ViewNotFound(String)
View not found
LockAcquisitionFailed(String)
Failed to acquire lock
NoRowsReturned
Query returned no rows
NoStatementsToExecute
No statements to execute
ColumnIndexOutOfBounds
Column index out of bounds
WalNotRunning
WAL manager is not running
WalFileClosed
WAL file is closed
WalNotInitialized
WAL not initialized
DatabaseLocked
Database is locked by another process
CannotDropPrimaryKey
Cannot drop primary key column
NullComparison
Cannot compare NULL with non-NULL value
IncomparableTypes
Cannot compare incompatible types
NotSupported
Operation not supported
SegmentNotFound
Segment not found (internal storage error)
ExpressionEvaluation
Expression evaluation failed
ExpressionEvaluationWithMessage
Expression evaluation failed with message
TypeConversion
Type conversion error
Parse
Parse error for timestamps or other values
Io
IO error (wrapped)
Internal
Internal error for unexpected conditions
TableExists(String)
Table already exists (with name)
TableNotFoundByName(String)
Table not found (with name)
TableOrViewNotFound(String)
Table or view not found (with name)
ColumnNotFoundNamed(String)
Column not found (with name) - for executor
Type(String)
Type error
DivisionByZero
Division by zero
QueryCancelled
Query cancelled
NotSupportedMessage(String)
Operation not supported (with message)
ParseError(String)
Parse error (string variant)
InvalidArgumentMessage(String)
Invalid argument (string variant)
Implementations§
Source§impl Error
impl Error
Sourcepub fn table_columns_not_match(expected: usize, got: usize) -> Self
pub fn table_columns_not_match(expected: usize, got: usize) -> Self
Create a new TableColumnsNotMatch error
Sourcepub fn value_too_long(column: impl Into<String>, max: usize, got: usize) -> Self
pub fn value_too_long(column: impl Into<String>, max: usize, got: usize) -> Self
Create a new ValueTooLong error
Sourcepub fn not_null_constraint(column: impl Into<String>) -> Self
pub fn not_null_constraint(column: impl Into<String>) -> Self
Create a new NotNullConstraint error
Sourcepub fn primary_key_constraint(row_id: i64) -> Self
pub fn primary_key_constraint(row_id: i64) -> Self
Create a new PrimaryKeyConstraint error
Sourcepub fn unique_constraint(
index: impl Into<String>,
column: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn unique_constraint( index: impl Into<String>, column: impl Into<String>, value: impl Into<String>, ) -> Self
Create a new UniqueConstraint error
Sourcepub fn column_not_found_by_name(name: impl Into<String>) -> Self
pub fn column_not_found_by_name(name: impl Into<String>) -> Self
Create a new ColumnNotFoundByName error
Sourcepub fn type_conversion(from: impl Into<String>, to: impl Into<String>) -> Self
pub fn type_conversion(from: impl Into<String>, to: impl Into<String>) -> Self
Create a new TypeConversion error
Sourcepub fn expression_evaluation(message: impl Into<String>) -> Self
pub fn expression_evaluation(message: impl Into<String>) -> Self
Create a new ExpressionEvaluationWithMessage error
Sourcepub fn invalid_argument(message: impl Into<String>) -> Self
pub fn invalid_argument(message: impl Into<String>) -> Self
Create a new InvalidArgument error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a “not found” type error
Sourcepub fn is_constraint_violation(&self) -> bool
pub fn is_constraint_violation(&self) -> bool
Check if this is a constraint violation error
Sourcepub fn is_transaction_error(&self) -> bool
pub fn is_transaction_error(&self) -> bool
Check if this is a transaction-related error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more