pub enum RusticxError {
ConnectionError(String),
QueryError(String),
TransactionError(String),
SerializationError(String),
ValidationError(String),
NotFound(String),
InvalidColumn(String),
DatabaseError(String),
FeatureNotEnabled(String),
DeserializationError(String),
}Expand description
Represents the various errors that can occur in the Rusticx ORM.
This enum encapsulates different types of errors that might arise during database operations, serialization/deserialization, validation, or connection management.
Variants§
ConnectionError(String)
Represents a connection error with a message detailing the issue.
This error typically occurs when establishing or managing connections to the database.
QueryError(String)
Represents a query execution error with a message detailing the issue.
This error occurs when a SQL query fails to execute successfully on the database.
TransactionError(String)
Represents a transaction error with a message detailing the issue.
This error covers failures during the lifecycle of a database transaction, such as starting, committing, or rolling back.
SerializationError(String)
Represents a serialization error with a message detailing the issue.
This error occurs when converting Rust data structures into a format suitable for the database (e.g., JSON, specific database types).
ValidationError(String)
Represents a validation error with a message detailing the issue.
This error can be used for business logic validations that fail before interacting with the database.
NotFound(String)
Represents an error when a requested item (e.g., a database record) is not found.
InvalidColumn(String)
Represents an error when an invalid column name or definition is specified.
DatabaseError(String)
Represents a general database error with a message detailing the issue.
This is a catch-all for database-related errors that don’t fit into
more specific categories like QueryError or ConnectionError.
FeatureNotEnabled(String)
Represents an error when a requested feature (e.g., support for a specific database) is not enabled.
DeserializationError(String)
Represents an error during deserialization with a message detailing the issue.
This error occurs when converting data received from the database (e.g., rows, JSON) into Rust data structures.
Trait Implementations§
Source§impl Debug for RusticxError
impl Debug for RusticxError
Source§impl Display for RusticxError
Implements the fmt::Display trait for RusticxError.
impl Display for RusticxError
Implements the fmt::Display trait for RusticxError.
This allows RusticxError instances to be easily printed using {}
format specifier, providing a user-friendly representation of the error.
Source§impl Error for RusticxError
Implements the std::error::Error trait for RusticxError.
impl Error for RusticxError
Implements the std::error::Error trait for RusticxError.
This makes RusticxError a standard error type in Rust, allowing it
to be used with features like ? operator for easy error propagation
and boxed dynamic error types (Box<dyn std::error::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
Source§impl From<Error> for RusticxError
Implements conversion from tokio_postgres::Error to RusticxError.
impl From<Error> for RusticxError
Implements conversion from tokio_postgres::Error to RusticxError.
This simplifies error handling by automatically converting errors from
the tokio-postgres crate into a RusticxError::QueryError.
Source§impl From<Error> for RusticxError
Implements conversion from serde_json::Error to RusticxError.
impl From<Error> for RusticxError
Implements conversion from serde_json::Error to RusticxError.
This simplifies error handling by automatically converting errors from
the serde_json crate into a RusticxError::SerializationError.