Skip to main content

graphyn_core/
error.rs

1#[derive(thiserror::Error, Debug)]
2pub enum GraphynError {
3    #[error("Symbol not found: {0}")]
4    SymbolNotFound(String),
5
6    #[error("Parse error in {file}:{line} — {message}")]
7    ParseError {
8        file: String,
9        line: u32,
10        message: String,
11    },
12
13    #[error("Graph is corrupt: {0}")]
14    GraphCorrupt(String),
15
16    #[error("Storage error: {0}")]
17    StorageError(String),
18
19    #[error("Ambiguous symbol '{symbol}', provide file. Candidates: {candidates:?}")]
20    AmbiguousSymbol {
21        symbol: String,
22        candidates: Vec<String>,
23    },
24
25    #[error("Invalid depth '{depth}', max allowed is {max}")]
26    InvalidDepth { depth: usize, max: usize },
27}