use mediaway_container::mp4::Error as MuxError;
use thiserror::Error;
#[derive(Debug, Error)]
pub(crate) enum CliError {
#[error("{0}")]
Usage(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("mux error: {0}")]
Mux(#[from] MuxError),
}
impl CliError {
pub(crate) const fn exit_code(&self) -> i32 {
match self {
Self::Usage(_) => 2,
Self::Io(_) | Self::Mux(_) => 1,
}
}
}