reinhardt_db/pool/
errors.rs1use thiserror::Error;
4
5#[non_exhaustive]
6#[derive(Error, Debug)]
7pub enum PoolError {
9 #[error("Pool is closed")]
10 PoolClosed,
12
13 #[error("Connection timeout")]
14 Timeout,
16
17 #[error("Pool exhausted (max connections reached)")]
18 PoolExhausted,
20
21 #[error("Invalid connection")]
22 InvalidConnection,
24
25 #[error("Database error: {0}")]
26 Database(#[from] sqlx::Error),
28
29 #[error("Configuration error: {0}")]
30 Config(String),
32
33 #[error("Connection error: {0}")]
34 Connection(String),
36
37 #[error("Pool not found: {0}")]
38 PoolNotFound(String),
40}
41
42pub type PoolResult<T> = Result<T, PoolError>;