pub enum VmError {
Panic(String),
TypeMismatch(String),
StackUnderflow,
UnknownFunction(String),
Effect(String),
CallStackOverflow(u32),
RefinementFailed {
fn_name: String,
param_index: usize,
binding: String,
reason: String,
},
DivByZero {
op: &'static str,
},
}Variants§
Panic(String)
TypeMismatch(String)
StackUnderflow
UnknownFunction(String)
Effect(String)
CallStackOverflow(u32)
RefinementFailed
Refinement predicate failed at a call boundary (#209 slice 3).
Surfaced when a function declares param :: Type{x | predicate},
the call-site arg couldn’t be discharged statically (slice 2),
and the runtime evaluator finds the predicate is false for
the actual argument value. The verdict mirrors the shape of
gate.verdict-style records in lex-trace.
DivByZero
Integer division or modulo with a zero divisor (#696). Without
this guard the host //% panics and takes the whole process
down — the crash report had a conformance harness compute a
rate over an empty set in teardown, far from any user-visible
division. Surfacing a catchable VmError instead keeps the
failure inside the language’s error model. Float div/mod is
exempt: IEEE-754 yields inf/NaN rather than trapping.
Trait Implementations§
Source§impl Error for VmError
impl Error for VmError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()