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

#[allow(clippy::large_enum_variant)]
#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("ZFS error")]
    ZFS(String),

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

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

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

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