1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3 #[error("parse the expression: {0}")]
4 Parse(String),
5
6 #[error("no such variable `{0}`")]
7 NoSuchVar(String),
8
9 #[error("no such function `{0}`")]
10 NoSuchFunction(String),
11
12 #[error("invalid value {0}")]
13 InvalidValue(String),
14
15 #[error("type mismatch: expected same type for comparison, got {0:?} and {1:?}")]
16 TypeMismatch(String, String),
17
18 #[error("unsupported character: {0}")]
19 UnsupportedCharacter(char),
20
21 #[error("invalid argument count: expected {expected}, got {got}")]
22 InvalidArgumentCount { expected: usize, got: usize },
23
24 #[error("invalid argument type: expected {expected}, got {got}")]
25 InvalidArgumentType { expected: String, got: String },
26
27 #[error("internal: {0}")]
28 Internal(String),
29}