plotnik_vm/engine/
error.rs

1//! Runtime errors for VM execution.
2
3use plotnik_bytecode::ModuleError;
4
5/// Errors during VM execution.
6#[derive(Debug, thiserror::Error)]
7pub enum RuntimeError {
8    /// Internal signal for successful completion (not a real error).
9    #[error("accept")]
10    Accept,
11
12    /// Internal signal that backtracking occurred (control returns to main loop).
13    #[error("backtracked")]
14    Backtracked,
15
16    #[error("execution fuel exhausted after {0} steps")]
17    ExecFuelExhausted(u32),
18
19    #[error("recursion limit exceeded (depth {0})")]
20    RecursionLimitExceeded(u32),
21
22    #[error("no match found")]
23    NoMatch,
24
25    #[error("invalid entrypoint: {0}")]
26    #[allow(dead_code)]
27    InvalidEntrypoint(String),
28
29    #[error("module error: {0}")]
30    Module(#[from] ModuleError),
31}