1#[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 #[cfg(target_os = "linux")]
22 ParseMountInfo {
23 source: crate::linux::ParseMountInfoError,
24 },
25
26 #[snafu(display("Unexpected format"))]
27 UnexpectedFormat,
28
29 #[snafu(display("Error parsing device id"))]
30 ParseDeviceId,
31
32 #[snafu(display("Failed to call service {service:?}"))]
33 ServiceCallFailed { service: &'static str },
34
35 #[snafu(display("Failed to read {key:?}"))]
36 MissingValue { key: &'static str },
37
38 #[snafu(display("Device layer not found"))]
39 DeviceLayerNotFound,
40}