lfs_core/
error.rs

1/// lfs error type
2#[derive(Debug, snafu::Snafu)]
3#[snafu(visibility(pub(crate)))]
4pub enum Error {
5    #[snafu(display("Couldn't execute {exe}"))]
6    CantExecute { source: std::io::Error, exe: String },
7
8    #[snafu(display("Could not read file {path:?}"))]
9    CantReadFile {
10        source: std::io::Error,
11        path: std::path::PathBuf,
12    },
13
14    #[snafu(display("Could not read dir {path:?}"))]
15    CantReadDir {
16        source: std::io::Error,
17        path: std::path::PathBuf,
18    },
19
20    #[snafu(display("Could not parse mountinfo"))]
21    ParseMountInfo { source: crate::ParseMountInfoError },
22
23    #[snafu(display("Unexpected format"))]
24    UnexpectedFormat,
25
26    #[snafu(display("Error parsing device id"))]
27    ParseDeviceId,
28
29    #[snafu(display("Failed to call service {service:?}"))]
30    ServiceCallFailed { service: &'static str },
31
32    #[snafu(display("Failed to read {key:?}"))]
33    MissingValue { key: &'static str },
34
35    #[snafu(display("Device layer not found"))]
36    DeviceLayerNotFound,
37}