Skip to main content

meshdb_executor/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4#[non_exhaustive]
5pub enum Error {
6    #[error("storage: {0}")]
7    Storage(#[from] meshdb_storage::Error),
8
9    #[error("unbound variable: {0}")]
10    UnboundVariable(String),
11
12    #[error("unbound parameter: ${0}")]
13    UnboundParameter(String),
14
15    #[error("expected boolean value")]
16    NotBoolean,
17
18    #[error("type mismatch in comparison")]
19    TypeMismatch,
20
21    #[error("DeletedEntityAccess: {0}")]
22    DeletedEntityAccess(String),
23
24    #[error("cannot access property on non-node/edge value")]
25    NotNodeOrEdge,
26
27    #[error("unsupported comparison for type")]
28    UnsupportedComparison,
29
30    #[error("cannot DELETE node with attached edges (use DETACH DELETE)")]
31    CannotDeleteAttachedNode,
32
33    #[error("SET value must be a primitive property, not a node or edge")]
34    InvalidSetValue,
35
36    #[error("function `{0}` is not a scalar function; only aggregate calls are supported")]
37    UnknownScalarFunction(String),
38
39    #[error("aggregate argument has unsupported type")]
40    AggregateTypeError,
41
42    #[error("write failed: {0}")]
43    Write(String),
44
45    #[error("remote read failed: {0}")]
46    Remote(String),
47
48    #[error("unsupported: {0}")]
49    Unsupported(String),
50
51    #[error("integer division or modulo by zero")]
52    DivideByZero,
53
54    #[error("invalid regular expression: {0}")]
55    InvalidRegex(String),
56
57    #[error("procedure error: {0}")]
58    Procedure(String),
59
60    #[error("invalid argument value: {0}")]
61    InvalidArgumentValue(String),
62}
63
64pub type Result<T> = std::result::Result<T, Error>;