1use std::io;
7use std::path::PathBuf;
8use std::result::Result as StdResult;
9
10#[derive(Debug, thiserror::Error)]
11pub enum Error {
12 #[error("I/O error: {0}")]
13 Io(#[from] io::Error),
14
15 #[error("No source files found in {0}")]
16 NoSourceFiles(PathBuf),
17
18 #[error("{field} must be {expected}, got {value}")]
19 InvalidConfig {
20 field: &'static str,
21 value: String,
22 expected: &'static str,
23 },
24
25 #[error("baseline {}: {problem}", .path.display())]
26 Baseline { path: PathBuf, problem: String },
27
28 #[error("{0}")]
29 Other(String),
30}
31
32pub type Result<T> = StdResult<T, Error>;