pub enum EFError {
Connection(String, Option<BoxError>),
Query(String, Option<BoxError>),
NotFound(String, Option<BoxError>),
ModelValidation(String, Option<BoxError>),
Migration(String, Option<BoxError>),
Provider(String, Option<BoxError>),
Configuration(String, Option<BoxError>),
ChangeTracking(String, Option<BoxError>),
Transaction(String, Option<BoxError>),
ConcurrencyConflict(String, Option<BoxError>),
TypeConversion(String, Option<BoxError>),
Other(String, Option<BoxError>),
}Expand description
Represents all possible errors that can occur in rust-ef operations.
Variants§
Connection(String, Option<BoxError>)
Database connection error.
Query(String, Option<BoxError>)
Query execution error.
NotFound(String, Option<BoxError>)
Entity not found error.
ModelValidation(String, Option<BoxError>)
Model validation error.
Migration(String, Option<BoxError>)
Migration error.
Provider(String, Option<BoxError>)
Provider-specific error.
Configuration(String, Option<BoxError>)
Configuration error.
ChangeTracking(String, Option<BoxError>)
Change tracking error.
Transaction(String, Option<BoxError>)
Transaction error.
ConcurrencyConflict(String, Option<BoxError>)
Concurrency conflict error.
TypeConversion(String, Option<BoxError>)
Type conversion error.
Other(String, Option<BoxError>)
General / unknown error.
Implementations§
Source§impl EFError
impl EFError
pub fn connection(msg: impl Into<String>) -> Self
pub fn query(msg: impl Into<String>) -> Self
pub fn not_found(msg: impl Into<String>) -> Self
pub fn model_validation(msg: impl Into<String>) -> Self
pub fn migration(msg: impl Into<String>) -> Self
pub fn provider(msg: impl Into<String>) -> Self
pub fn configuration(msg: impl Into<String>) -> Self
pub fn change_tracking(msg: impl Into<String>) -> Self
pub fn transaction(msg: impl Into<String>) -> Self
pub fn concurrency_conflict(msg: impl Into<String>) -> Self
pub fn type_conversion(msg: impl Into<String>) -> Self
pub fn other(msg: impl Into<String>) -> Self
Sourcepub fn with_source(self, source: BoxError) -> Self
pub fn with_source(self, source: BoxError) -> Self
Attaches a source error to this EFError, preserving the error chain.
Sourcepub fn code(&self) -> EFErrorCode
pub fn code(&self) -> EFErrorCode
Returns a stable EFErrorCode for programmatic dispatch.
Sub-categories within a variant are detected via case-insensitive
message patterns (e.g. "timeout" → ConnectionTimeout). Messages
are stable internal strings produced by rust-ef’s own call sites;
user-supplied messages from EFError::other fall back to Unknown.
Trait Implementations§
Source§impl Error for EFError
impl Error for EFError
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()