pub enum VmError {
Panic(String),
TypeMismatch(String),
StackUnderflow,
UnknownFunction(String),
Effect(String),
ProcessExit(i32),
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)
ProcessExit(i32)
The program called std.process.exit(code) (#754).
Not a failure — a deliberate signal — but it travels the error
channel because that is the VM’s only unwind path, and unwinding
is the point: the alternative is calling std::process::exit
inside the handler, which would terminate the process where it
stands and silently skip everything lex run does after the
call returns (finalising the trace, writing the Trace
attestation, recording committed ops). A run that exits is still
a run that happened, and it should leave the same evidence.
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()