1use std::error::Error as StdError;
2
3pub type BoxDynError = Box<dyn StdError + 'static + Send + Sync>;
4
5#[derive(Debug, thiserror::Error)]
6#[non_exhaustive]
7pub enum Error {
8 #[error("error with configuration: {0}")]
10 Configuration(#[source] BoxDynError),
11 #[error("error communicating with database: {0}")]
13 Io(#[from] std::io::Error),
14
15 #[error("pool timed out while waiting for an open connection")]
20 PoolTimedOut,
21
22 #[error("attempted to acquire a connection on a closed pool")]
27 PoolClosed,
28
29 #[error("error response from server")]
30 ResponseError,
31
32 #[error("error with connection")]
33 Other(#[from] anyhow::Error),
34}