sqlw_backend/error.rs
1//! Database operation error types.
2
3/// Database operation error.
4#[derive(Debug, thiserror::Error)]
5pub enum DBError {
6 /// Connection-related error (failed to connect, pool exhausted, etc.)
7 #[error("connection error: {0}")]
8 Connection(#[source] Box<dyn std::error::Error + Send + Sync>),
9
10 /// Runtime execution related error
11 #[error("query error: {0}")]
12 Execution(#[source] Box<dyn std::error::Error + Send + Sync>),
13
14 /// Row mapping error (failed to deserialize row into struct)
15 #[error("mapping error: {0}")]
16 Mapping(#[from] sqlw::RowError),
17
18 /// Transaction error (commit/rollback failed, nested transaction issue)
19 #[error("transaction error: {0}")]
20 Transaction(#[source] Box<dyn std::error::Error + Send + Sync>),
21}