use std::path::PathBuf;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("required tool `{0}` was not found on PATH")]
ToolNotFound(String),
#[error("`{tool}` exited with status {code}: {message}")]
ProcessFailed {
tool: String,
code: i32,
message: String,
},
#[error(
"interactive input required for `{prompt}` but running in --non-interactive mode; pass {flag} instead"
)]
NonInteractive {
prompt: String,
flag: String,
},
#[error("file not found: {0}")]
FileNotFound(PathBuf),
#[error("failed to parse {path}: {source}")]
Parse {
path: PathBuf,
#[source]
source: serde_yaml_ng::Error,
},
#[error("validation failed: {0}")]
Validation(String),
#[error("not inside a git repository")]
NotAGitRepo,
#[error("{0} is only supported on macOS")]
UnsupportedPlatform(String),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Yaml(#[from] serde_yaml_ng::Error),
#[error(transparent)]
Other(#[from] anyhow::Error),
}