use std::io;
use thiserror::Error;
#[derive(Debug, Error)]
pub(crate) enum ProbeError {
#[error("{0}")]
Usage(String),
#[error("failed to read '{path}': {source}")]
Read {
path: String,
source: io::Error,
},
#[error("unsupported or unparseable container in '{path}'")]
Unsupported {
path: String,
},
}
impl ProbeError {
pub(crate) const fn exit_code(&self) -> i32 {
match self {
Self::Usage(_) => 2,
Self::Read { .. } | Self::Unsupported { .. } => 1,
}
}
}