shuttle_service/
error.rs

1//! Types representing various errors that can occur in the process of building and deploying a service.
2
3/// An error that can occur in the process of building and deploying a service.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    /// An Input/Output error.
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9    /// An Error related to the database.
10    #[error("Database error: {0}")]
11    Database(String),
12    /// An error related to the build process.
13    #[error("Panic occurred in shuttle_service::main`: {0}")]
14    BuildPanic(String),
15    /// An error related to the bind process.
16    #[error("Panic occurred in `Service::bind`: {0}")]
17    BindPanic(String),
18    /// An error related to parsing the Secrets.toml file.
19    #[error("Failed to interpolate string. Is your Secrets.toml correct?")]
20    StringInterpolation(#[from] strfmt::FmtError),
21    #[error(transparent)]
22    Custom(#[from] CustomError),
23}
24
25/// Type alias for an `anyhow::Error`.
26pub type CustomError = anyhow::Error;