1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, AnalyzerError>;
7
8#[derive(Error, Debug)]
10pub enum AnalyzerError {
11 #[error("Failed to read file: {path}")]
13 FileReadError {
14 path: String,
15 #[source]
16 source: std::io::Error,
17 },
18
19 #[error("Failed to write file: {path}")]
21 FileWriteError {
22 path: String,
23 #[source]
24 source: std::io::Error,
25 },
26
27 #[error("Failed to parse Rust code in {path}")]
29 ParseError {
30 path: String,
31 #[source]
32 source: syn::Error,
33 },
34
35 #[error("Failed to serialize result")]
37 SerializationError(#[from] serde_json::Error),
38
39 #[error("Invalid input: {0}")]
41 InvalidInput(String),
42}