aboutsummaryrefslogtreecommitdiffstats
path: root/zone_nspawn/src/error.rs
blob: a4ba175e5e0b99d3ea4a8663149259b53c3c1e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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),

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

    #[error("Config Error: {0:?}")]
    Config(#[from] figment::Error),

    #[error("Builder Error: {0:?}")]
    Builder(#[from] crate::container::ContainerBuilderError),

    #[error("Serialize Error: {0:?}")]
    Serialize(#[from] serde_ini::ser::Error),
}