pub enum Error {
Show 16 variants
Connection {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Query {
message: String,
sql: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Transaction {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Constraint {
constraint_name: String,
message: String,
},
TypeConversion {
message: String,
},
Timeout {
message: String,
},
Deadlock,
Authentication {
message: String,
},
Configuration {
message: String,
},
PoolExhausted {
message: String,
},
Schema {
message: String,
},
PreparedStatementNotFound {
name: String,
},
TableNotFound {
table: String,
},
ColumnNotFound {
table: String,
column: String,
},
Unsupported {
message: String,
},
Internal {
message: String,
},
}Expand description
Main error type for rivven-rdbc
Variants§
Connection
Connection failed
Query
Query execution failed
Transaction
Transaction error
Constraint
Constraint violation (PK, FK, unique, check)
TypeConversion
Type conversion failed
Timeout
Operation timed out
Deadlock
Deadlock detected
Authentication
Authentication failed
Configuration
Configuration error
PoolExhausted
Connection pool exhausted
Schema
Schema error (table not found, column mismatch)
PreparedStatementNotFound
Prepared statement not found
TableNotFound
Table not found
ColumnNotFound
Column not found
Unsupported
Unsupported operation for this backend
Internal
Internal error
Implementations§
Source§impl Error
impl Error
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Get the error category
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Whether this error is retriable
Sourcepub fn connection(message: impl Into<String>) -> Self
pub fn connection(message: impl Into<String>) -> Self
Create a connection error
Sourcepub fn connection_with_source(
message: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn connection_with_source( message: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
Create a connection error with source
Sourcepub fn query_with_sql(
message: impl Into<String>,
sql: impl Into<String>,
) -> Self
pub fn query_with_sql( message: impl Into<String>, sql: impl Into<String>, ) -> Self
Create a query error with SQL
Sourcepub fn type_conversion(message: impl Into<String>) -> Self
pub fn type_conversion(message: impl Into<String>) -> Self
Create a type conversion error
Sourcepub fn transaction(message: impl Into<String>) -> Self
pub fn transaction(message: impl Into<String>) -> Self
Create a transaction error
Sourcepub fn execution(message: impl Into<String>) -> Self
pub fn execution(message: impl Into<String>) -> Self
Create an execution error (alias for query)
Sourcepub fn unsupported(message: impl Into<String>) -> Self
pub fn unsupported(message: impl Into<String>) -> Self
Create an unsupported operation error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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> 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
Mutably borrows from an owned value. Read more