datafusion_dist_cluster_postgres/
error.rs

1use bb8_postgres::tokio_postgres::Error as PgError;
2use datafusion_dist::DistError;
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum PostgresClusterError {
7    #[error("PostgreSQL connection error: {0}")]
8    Connection(#[from] PgError),
9
10    #[error("Connection pool error: {0}")]
11    Pool(#[from] bb8::RunError<PgError>),
12
13    #[error("Cluster query error: {0}")]
14    Query(String),
15}
16
17impl From<PostgresClusterError> for DistError {
18    fn from(err: PostgresClusterError) -> Self {
19        DistError::cluster(Box::new(err))
20    }
21}