#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum ExprError {
#[error("step limit exceeded after {0} steps")]
StepLimitExceeded(u64),
#[error("recursion depth exceeded: {0}")]
DepthExceeded(u32),
#[error("unbound variable: {0}")]
UnboundVariable(String),
#[error("type error: expected {expected}, got {got}")]
TypeError {
expected: String,
got: String,
},
#[error("arity mismatch for {op}: expected {expected}, got {got}")]
ArityMismatch {
op: String,
expected: usize,
got: usize,
},
#[error("index out of bounds: {index} for list of length {len}")]
IndexOutOfBounds {
index: i64,
len: usize,
},
#[error("field not found: {0}")]
FieldNotFound(String),
#[error("non-exhaustive match")]
NonExhaustiveMatch,
#[error("division by zero")]
DivisionByZero,
#[error("list length limit exceeded: {0}")]
ListLengthExceeded(usize),
#[error("parse error: cannot convert {value:?} to {target_type}")]
ParseError {
value: String,
target_type: String,
},
#[error("not a function")]
NotAFunction,
#[error("integer overflow")]
Overflow,
#[error("float not representable as integer: {0}")]
FloatNotRepresentable(String),
}