system-updater/src/errors.rs

28 lines
621 B
Rust
Raw Normal View History

2023-07-05 21:09:56 +02:00
// Use https://kazlauskas.me/entries/errors as a reference
2023-01-28 19:20:37 +01:00
use crate::*;
use std::io;
2023-01-28 22:24:39 +01:00
use std::result;
2023-07-05 21:09:56 +02:00
use thiserror::Error;
2023-01-28 22:24:39 +01:00
2023-07-05 21:09:56 +02:00
pub type Result<T> = result::Result<T, Error>;
2023-01-07 17:08:44 +01:00
/// An error that can occur in this crate.
///
/// Generally, this error corresponds to problems with underlying process.
#[non_exhaustive]
2023-07-05 21:09:56 +02:00
#[derive(Debug, Error)]
pub enum Error {
// #[error("TODO")]
// Config,
#[error(
"Could not achieve the \"{step}\" step. Command `{cmd}` resulted in an exited with: {source}"
)]
Execution {
source: io::Error,
step: UpdateSteps,
cmd: ActualCmd,
},
2023-01-07 17:08:44 +01:00
}