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

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("IO error: {0:?}")]
    IO(#[from] std::io::Error),

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

    #[error("Directories error: {0:?}")]
    Directories(#[from] crate::directories::Error),

    #[error("Process error: {0:?}")]
    Finder(String),

    #[error("Path error: {0:?}")]
    Path(#[from] PathError),
}

#[derive(thiserror::Error, Debug)]
pub enum PathError {
    #[error("Path contains invalid unicode: {0:?}")]
    Unicode(String),
}