petgraph_decypher/error.rs
1//! Error types for petgraph-decypher.
2
3use thiserror::Error;
4
5/// Errors that can occur when parsing or evaluating a Cypher query.
6#[derive(Debug, Error, PartialEq)]
7pub enum CypherError {
8 /// The query string could not be parsed.
9 #[error("parse error: {0}")]
10 ParseError(String),
11
12 /// A feature required by the query is not yet implemented.
13 #[error("unsupported clause or feature: {0}")]
14 Unsupported(String),
15
16 /// The query is structurally invalid (e.g. an unresolved variable).
17 #[error("invalid query: {0}")]
18 InvalidQuery(String),
19
20 /// A runtime type mismatch occurred during expression evaluation.
21 #[error("type mismatch: {0}")]
22 TypeMismatch(String),
23
24 /// Division by zero during expression evaluation.
25 #[error("division by zero")]
26 DivisionByZero,
27
28 /// An invalid operation was requested at runtime.
29 #[error("runtime error: {0}")]
30 RuntimeError(String),
31}