1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
use crate::Expr;
use thiserror::Error;
/// Crate-specific error enum.
#[derive(Debug, Error)]
#[allow(clippy::large_enum_variant)]
pub enum Error {
/// [geojson::Error]
#[error(transparent)]
GeoJSON(#[from] geojson::Error),
/// [geozero::error::GeozeroError]
#[error(transparent)]
Geozero(#[from] geozero::error::GeozeroError),
/// Invalid CQL2 text
#[error("invalid cql2-text: {0}")]
InvalidCql2Text(String),
/// Invalid number of arguments for the expression
#[error("invalid number of arguments for {name}: {actual} (expected {expected})")]
InvalidNumberOfArguments {
/// The name of the expression or operation
name: String,
/// The actual number of arguments
actual: usize,
/// The number of arguments the expression or operation expected
expected: usize,
},
/// [std::io::Error]
#[error(transparent)]
Io(#[from] std::io::Error),
/// Missing argument from a function that requires one.
#[error("function {0} is missing a required argument")]
MissingArgument(&'static str),
/// [std::str::ParseBoolError]
#[error(transparent)]
ParseBool(#[from] std::str::ParseBoolError),
/// [std::num::ParseFloatError]
#[error(transparent)]
ParseFloat(#[from] std::num::ParseFloatError),
/// [std::num::ParseIntError]
#[error(transparent)]
ParseInt(#[from] std::num::ParseIntError),
/// [jiff::Error]
#[error(transparent)]
ParseTimestamp(#[from] jiff::Error),
/// [pest::error::Error]
#[error(transparent)]
Pest(#[from] Box<pest::error::Error<crate::parser::Rule>>),
/// [serde_json::Error]
#[error(transparent)]
SerdeJson(#[from] serde_json::Error),
/// A validation error.
///
/// This holds a [serde_json::Value] that is the output from a
/// [boon::ValidationError]. We can't hold the validation error itself
/// becuase it contains references to both the validated object and the
/// validator's data.
#[error("validation error")]
Validation(serde_json::Value),
/// Error Converting Expr to f64
#[error("Could not convert Expression to f64")]
ExprToF64(Expr),
/// Error Converting Expr to bool
#[error("Could not convert Expression to bool")]
ExprToBool(Expr),
/// Error Converting Expr to geometry
#[error("Could not convert Expression to Geometry")]
ExprToGeom(Expr),
/// Error Converting Expr to DateRange
#[error("Could not convert Expression to DateRange")]
ExprToDateRange(Expr),
/// Operator not implemented.
#[error("Operator {0} is not implemented for this type.")]
OpNotImplemented(&'static str),
/// Invalid operator
#[error("{0} is not a valid operator.")]
InvalidOperator(String),
/// Expression not reduced to boolean
#[error("Could not reduce expression to boolean")]
NonReduced(),
/// Could not run arith operation
#[error("Could not run operation.")]
OperationError(),
/// [json_dotpath::Error]
#[error(transparent)]
JsonDotpath(#[from] json_dotpath::Error),
/// [like::Error]
#[error(transparent)]
Like(#[from] like::InvalidPatternError),
}