db_testkit/
error.rs

1use thiserror::Error;
2
3/// Error type for database pool operations
4#[derive(Debug, Error)]
5pub enum PoolError {
6    /// Failed to create a pool
7    #[error("Failed to create pool: {0}")]
8    PoolCreationFailed(String),
9
10    /// Failed to acquire a connection from the pool
11    #[error("Failed to acquire connection: {0}")]
12    ConnectionAcquisitionFailed(String),
13
14    /// Database error
15    #[error("Database error: {0}")]
16    DatabaseError(String),
17
18    /// Configuration error
19    #[error("Configuration error: {0}")]
20    ConfigError(String),
21
22    /// Invalid URL
23    #[error("Invalid URL: {0}")]
24    InvalidUrl(String),
25
26    /// Migration error
27    #[error("Migration error: {0}")]
28    MigrationError(String),
29}
30
31/// Result type for database pool operations
32pub type Result<T> = std::result::Result<T, PoolError>;