|
|
|
@ -21,6 +21,7 @@ pub enum AppError {
|
|
|
|
|
MakePkg(String),
|
|
|
|
|
MinusError(minus::MinusError),
|
|
|
|
|
FmtError(std::fmt::Error),
|
|
|
|
|
AlpmError(crate::internal::alpm::Error),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Display for AppError {
|
|
|
|
@ -36,9 +37,10 @@ impl Display for AppError {
|
|
|
|
|
AppError::MissingDependencies(deps) => {
|
|
|
|
|
write!(f, "Missing dependencies {}", deps.join(", "))
|
|
|
|
|
}
|
|
|
|
|
AppError::MakePkg(msg) => write!(f, "Failed to ru makepkg {msg}"),
|
|
|
|
|
AppError::MakePkg(msg) => write!(f, "Failed to run makepkg {msg}"),
|
|
|
|
|
AppError::MinusError(e) => Display::fmt(e, f),
|
|
|
|
|
AppError::FmtError(e) => Display::fmt(e, f),
|
|
|
|
|
AppError::AlpmError(e) => Display::fmt(e, f),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -81,6 +83,12 @@ impl From<std::fmt::Error> for AppError {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl From<crate::internal::alpm::Error> for AppError {
|
|
|
|
|
fn from(e: crate::internal::alpm::Error) -> Self {
|
|
|
|
|
Self::AlpmError(e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub trait SilentUnwrap<T> {
|
|
|
|
|
fn silent_unwrap(self, error_code: AppExitCode) -> T;
|
|
|
|
|
}
|
|
|
|
|