Skip to main content

diffler_ci/
error.rs

1use thiserror::Error;
2
3/// Failures from acquiring CI data. Adapters surface these; the host maps them
4/// to a status-bar message and degrades (no runs / no DAG / no logs) rather than
5/// crashing.
6#[derive(Debug, Error)]
7pub enum CiError {
8    #[error("the `{0}` CLI is not installed or not on PATH")]
9    CliMissing(&'static str),
10    #[error("`{cmd}` failed: {message}")]
11    Exec { cmd: String, message: String },
12    #[error("parsing {what}: {message}")]
13    Parse { what: String, message: String },
14    #[error("not found: {0}")]
15    NotFound(String),
16    #[error("unsupported by this provider: {0}")]
17    Unsupported(&'static str),
18}
19
20pub type Result<T> = std::result::Result<T, CiError>;