Files
topgrade/src/error.rs

29 lines
625 B
Rust
Raw Normal View History

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