1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum PolyDupError {
6 #[error("IO error: {0}")]
7 Io(#[from] std::io::Error),
8
9 #[error("Language parsing error: {0}")]
10 Parsing(String),
11
12 #[error("Configuration error: {0}")]
13 Config(String),
14
15 #[error("Language not supported for file: {0}")]
16 LanguageNotSupported(String),
17
18 #[error("Failed to detect language for file: {0}")]
19 LanguageDetection(PathBuf),
20
21 #[error("Parallel execution error: {0}")]
22 ParallelExecution(String),
23
24 #[error("Ignore rule error: {0}")]
25 IgnoreRule(String),
26
27 #[error(transparent)]
28 Other(#[from] anyhow::Error),
29}
30
31pub type Result<T> = std::result::Result<T, PolyDupError>;