codegraph_parser_api/
errors.rs1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
6pub enum ParserError {
7 #[error("IO error reading {0}: {1}")]
9 IoError(PathBuf, #[source] std::io::Error),
10
11 #[error("Syntax error in {0}:{1}:{2}: {3}")]
13 SyntaxError(PathBuf, usize, usize, String),
14
15 #[error("File {0} exceeds maximum size ({1} bytes)")]
17 FileTooLarge(PathBuf, usize),
18
19 #[error("Parsing {0} exceeded timeout")]
21 Timeout(PathBuf),
22
23 #[error("Failed to insert into graph: {0}")]
25 GraphError(String),
26
27 #[error("Unsupported language feature in {0}: {1}")]
29 UnsupportedFeature(PathBuf, String),
30
31 #[error("Parse error in {0}: {1}")]
33 ParseError(PathBuf, String),
34}
35
36pub type ParserResult<T> = Result<T, ParserError>;