aboutsummaryrefslogtreecommitdiffstats
path: root/zone_nspawn/src/error.rs
blob: e5af696e94c7ea81b284b7724d02e28331e4c9b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub type Result<T> = std::result::Result<T, Error>;

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("NSpawn Error: {0:?}")]
    NSpawn(String),

    #[error("Parsing Error: {0:?}")]
    Parsing(String),

    #[error("Failed to run command: {0:?}")]
    Io(#[from] std::io::Error),

    #[error("Failed to deserialize json: {0:?}")]
    Json(#[from] serde_json::Error),

    #[error("Failed to parse Command output: {0:?}")]
    Utf8(#[from] std::string::FromUtf8Error),
}