2018-12-11 16:43:26 +02:00
|
|
|
use std::process::ExitStatus;
|
2019-12-11 23:05:38 +02:00
|
|
|
use thiserror::Error;
|
2018-12-11 16:43:26 +02:00
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
|
pub enum TopgradeError {
|
|
|
|
|
#[error("{0}")]
|
2018-12-11 16:43:26 +02:00
|
|
|
ProcessFailed(ExitStatus),
|
|
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[error("Unknown Linux Distribution")]
|
2018-12-11 16:43:26 +02:00
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
|
UnknownLinuxDistribution,
|
|
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[error("A pull action was failed")]
|
|
|
|
|
PullFailed,
|
2018-12-11 16:43:26 +02:00
|
|
|
}
|
|
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
#[error("A step failed")]
|
|
|
|
|
pub struct StepFailed;
|
2018-12-11 16:43:26 +02:00
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
#[error("A step should be skipped")]
|
|
|
|
|
pub struct SkipStep;
|
2018-12-11 16:43:26 +02:00
|
|
|
|
2019-12-11 23:05:38 +02:00
|
|
|
#[cfg(all(windows, feature = "self-update"))]
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
#[error("Topgrade Upgraded")]
|
|
|
|
|
pub struct Upgraded(pub ExitStatus);
|