pg_setup/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("Unable to parse postgres URL: {0}")]
    PgUrlParseError(String),
    #[error("Error running process {0}")]
    ProcessError(#[from] std::io::Error),
    #[cfg(feature = "sqlx")]
    #[error("Sqlx error: {0}")]
    SqlxError(#[from] sqlx::Error),
    #[error("{0}")]
    Other(String),
}

// type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
pub type Result<T> = std::result::Result<T, Error>;