use std::error::Error as StdError;
pub type BoxDynError = Box<dyn StdError + 'static + Send + Sync>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("error with configuration: {0}")]
Configuration(#[source] BoxDynError),
#[error("error communicating with database: {0}")]
Io(#[from] std::io::Error),
#[error("pool timed out while waiting for an open connection")]
PoolTimedOut,
#[error("attempted to acquire a connection on a closed pool")]
PoolClosed,
#[error("error response from server")]
ResponseError,
#[error("error with connection")]
Other(#[from] anyhow::Error),
}