1use cljrs_value::Value;
4
5#[derive(Debug, thiserror::Error)]
6pub enum EvalError {
7 #[error("runtime error: {0}")]
8 Runtime(String),
9
10 #[error("unbound symbol: {0}")]
11 UnboundSymbol(String),
12
13 #[error("arity error calling {name}: expected {expected}, got {got}")]
14 Arity {
15 name: String,
16 expected: String,
17 got: usize,
18 },
19
20 #[error("not callable: {0}")]
21 NotCallable(String),
22
23 #[error("{0}")]
25 Thrown(Value),
26
27 #[error("read error: {0}")]
28 Read(#[from] cljrs_types::error::CljxError),
29
30 #[doc(hidden)]
33 #[error("internal: recur outside loop or fn")]
34 Recur(Vec<Value>),
35}
36
37pub type EvalResult<T = Value> = Result<T, EvalError>;