aboutsummaryrefslogtreecommitdiffstats
path: root/zone_zfs/src/error.rs
blob: 872804bb9aa536929680fb522c99b7dd386e953f (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
pub type Result<T> = std::result::Result<T, Error>;

#[allow(clippy::large_enum_variant)]
#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("ZFS error: {0:?}")]
    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),

    #[error(transparent)]
    Builder(#[from] crate::file_system::FileSystemBuilderError),
}