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