use anyerror::AnyError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum StartupError {
#[error("Failed to add node to cluster: {source}")]
AddNodeError { source: AnyError },
#[error("Invalid configuration: {0}")]
InvalidConfig(String),
#[error("{0}")]
OtherError(String),
}
impl StartupError {
pub fn add_node_error(source: AnyError) -> Self {
Self::AddNodeError { source }
}
pub fn invalid_config(message: impl Into<String>) -> Self {
Self::InvalidConfig(message.into())
}
}