Reorder variants

This commit is contained in:
Chris Tsang 2022-10-07 00:15:36 +08:00
parent 1225255431
commit a44017f679

View File

@ -18,6 +18,15 @@ pub enum DbErr {
/// TryError /// TryError
source: Box<dyn std::error::Error + Send + Sync>, source: Box<dyn std::error::Error + Send + Sync>,
}, },
/// There was a problem with the database connection
#[error("Connection Error: {0}")]
Conn(#[source] RuntimeErr),
/// An operation did not execute successfully
#[error("Execution Error: {0}")]
Exec(#[source] RuntimeErr),
/// An error occurred while performing a query
#[error("Query Error: {0}")]
Query(#[source] RuntimeErr),
/// Type error: the specified type cannot be converted from u64. This is not a runtime error. /// Type error: the specified type cannot be converted from u64. This is not a runtime error.
#[error("Type '{0}' cannot be converted from u64")] #[error("Type '{0}' cannot be converted from u64")]
ConvertFromU64(&'static str), ConvertFromU64(&'static str),
@ -28,15 +37,6 @@ pub enum DbErr {
/// if the record has been correctly updated, otherwise this error will occur /// if the record has been correctly updated, otherwise this error will occur
#[error("Failed to get primary key from model")] #[error("Failed to get primary key from model")]
UpdateGetPrimeryKey, UpdateGetPrimeryKey,
/// There was a problem with the database connection
#[error("Connection Error: {0}")]
Conn(#[source] RuntimeErr),
/// An operation did not execute successfully
#[error("Execution Error: {0}")]
Exec(#[source] RuntimeErr),
/// An error occurred while performing a query
#[error("Query Error: {0}")]
Query(#[source] RuntimeErr),
/// The record was not found in the database /// The record was not found in the database
#[error("RecordNotFound Error: {0}")] #[error("RecordNotFound Error: {0}")]
RecordNotFound(String), RecordNotFound(String),