Skip to content

Commit 19bd141

Browse files
committed
Handle error in execute
1 parent 6bf1257 commit 19bd141

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ edition = "2024"
55

66
[dependencies]
77
dap = { git = "https://github.com/software-mansion-labs/dap-rs", rev = "4440a6f" }
8-
cairo-vm = { git = "https://github.com/software-mansion-labs/cairo-vm", rev = "da73729" }
8+
cairo-vm = { git = "https://github.com/software-mansion-labs/cairo-vm", rev = "aa83d6e" }
99
tracing = "0.1"
1010
anyhow = "1.0"

src/debugger/vm.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
use cairo_vm::vm::errors::vm_errors::VirtualMachineError;
12
use cairo_vm::vm::runners::hook::RunnerPreStepHook;
23
use cairo_vm::vm::vm_core::VirtualMachine;
34

45
use crate::CairoDebugger;
56

67
impl RunnerPreStepHook for CairoDebugger {
7-
fn execute(&self, vm: &VirtualMachine) {
8-
// TODO: Improve error handling
9-
self.sync_with_vm(vm).expect("Debugger failed");
8+
#[tracing::instrument(skip(self, vm), err)]
9+
fn execute(&self, vm: &VirtualMachine) -> Result<(), VirtualMachineError> {
10+
self.sync_with_vm(vm).map_err(VirtualMachineError::Other)
1011
}
1112
}

0 commit comments

Comments
 (0)