use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub(crate) enum CliError {
#[error("i/o error on {path}: {source}")]
Io {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("failed to decode image {path}: {source}")]
Decode {
path: PathBuf,
#[source]
source: image::ImageError,
},
#[error(transparent)]
Codec(#[from] gamut::core::Error),
#[error(transparent)]
Icc(#[from] gamut::icc::IccError),
#[error(
"unsupported output format: {0} (supported: 'avif', 'webp', 'tiff', 'png', 'jxl', 'jpg'/'jpeg')"
)]
UnsupportedOutput(String),
#[error("no embedded ICC profile found in {path}")]
NoIccProfile {
path: PathBuf,
},
#[error("{0}")]
NotFullyAccounted(String),
#[error("invalid argument: {0}")]
Usage(String),
}