use crate::bake::BakeError;
use crate::cli::LaunchArgumentError;
use crate::config::ConfigError;
use crate::launch::LaunchError;
use crate::session::SessionError;
#[derive(Debug, thiserror::Error)]
pub enum ClankerError {
#[error("$HOME is not set; set HOME or pass --config with an absolute path")]
HomeNotSet,
#[error("failed to resolve current working directory: {0}")]
CurrentDirectory(std::io::Error),
#[error("failed to resolve hostname: {0}")]
Hostname(String),
#[error("environment variable {0} is not valid UTF-8")]
NonUtf8Environment(&'static str),
#[error(transparent)]
LaunchArguments(#[from] LaunchArgumentError),
#[error(transparent)]
Config(#[from] ConfigError),
#[error(transparent)]
Launch(#[from] LaunchError),
#[error(transparent)]
Bake(#[from] Box<BakeError>),
#[error(transparent)]
Session(#[from] SessionError),
#[error("failed to serialize output: {0}")]
Json(#[from] serde_json::Error),
#[error("environment value for {0} is not valid UTF-8")]
NonUtf8EnvironmentOutput(String),
#[error("metadata command was not routed by the shared CLI runner")]
UnroutedMetadataCommand,
}
impl From<BakeError> for ClankerError {
fn from(error: BakeError) -> Self {
Self::Bake(Box::new(error))
}
}