diff options
Diffstat (limited to '')
-rw-r--r-- | matrix-lang/src/vm.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/matrix-lang/src/vm.rs b/matrix-lang/src/vm.rs index bac6341..b8da01f 100644 --- a/matrix-lang/src/vm.rs +++ b/matrix-lang/src/vm.rs @@ -217,7 +217,7 @@ impl Vm { let val = self.globals .borrow_mut() .get(&idx) - .unwrap() + .ok_or(exception!(RUNTIME_EXCEPTION, "undefined global at index {idx}"))? .clone(); self.stack.push(val); }, @@ -380,7 +380,7 @@ impl Vm { self.trystack.push(scope); }, I::TryEnd => { - self.trystack.pop().unwrap(); + self.trystack.pop().ok_or(exception!(RUNTIME_EXCEPTION, "try stack smashed"))?; }, }; |