Skip to main content

propel_core/
error.rs

1use std::path::PathBuf;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    #[error("failed to load config from {path}")]
8    ConfigLoad {
9        path: PathBuf,
10        source: std::io::Error,
11    },
12
13    #[error("failed to parse config at {path}")]
14    ConfigParse {
15        path: PathBuf,
16        source: toml::de::Error,
17    },
18
19    #[error("failed to read Cargo.toml at {path}")]
20    CargoTomlRead {
21        path: PathBuf,
22        source: std::io::Error,
23    },
24
25    #[error("failed to parse Cargo.toml at {path}")]
26    CargoTomlParse {
27        path: PathBuf,
28        source: toml::de::Error,
29    },
30
31    #[error("missing [package] section in Cargo.toml at {0}")]
32    MissingPackageSection(PathBuf),
33
34    #[error("missing package.name in Cargo.toml at {0}")]
35    MissingPackageName(PathBuf),
36}