1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum MutationError {
5 #[error("IO error: {0}")]
6 Io(#[from] std::io::Error),
7
8 #[error("JSON error: {0}")]
9 Json(#[from] serde_json::Error),
10
11 #[error("Git command failed: {0}")]
12 Git(String),
13
14 #[error("Command execution failed: {0}")]
15 Command(String),
16
17 #[error("Invalid input: {0}")]
18 InvalidInput(String),
19
20 #[error("Coverage parsing error: {0}")]
21 Coverage(String),
22
23 #[error("Regex error: {0}")]
24 Regex(#[from] regex::Error),
25
26 #[error("Walkdir error: {0}")]
27 Walkdir(#[from] walkdir::Error),
28
29 #[error("SQLite error: {0}")]
30 Rusqlite(#[from] rusqlite::Error),
31
32 #[error("Other error: {0}")]
33 Other(#[from] anyhow::Error),
34}
35
36pub type Result<T> = std::result::Result<T, MutationError>;