graphviz_pure_core/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error, Clone, PartialEq)]
5pub enum GraphvizError {
6 #[error("{message}")]
10 SyntaxError {
11 line: i32,
12 col: usize,
13 message: String,
14 file: Option<String>,
17 },
18
19 #[error("Unsupported layout engine: '{0}'")]
20 UnsupportedEngine(String),
21
22 #[error("Unsupported output format: '{0}'")]
23 UnsupportedFormat(String),
24
25 #[error("Layout computation error in {stage}: {message}")]
26 LayoutError {
27 stage: &'static str,
28 message: String,
29 },
30
31 #[error("Invalid attribute '{attr}': {message}")]
32 AttributeError { attr: String, message: String },
33
34 #[error("Rendering error: {0}")]
35 RenderError(String),
36}
37
38pub type Result<T> = std::result::Result<T, GraphvizError>;