Skip to content

Commit a5f08d7

Browse files
author
Matthew Hagemann
committed
Set trace_func / profile_func to none on error
1 parent b85e134 commit a5f08d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vm/src/protocol/callable.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,18 @@ impl VirtualMachine {
103103
self.use_tracing.set(false);
104104
let res = trace_func.call(args.clone(), self);
105105
self.use_tracing.set(true);
106-
res?;
106+
if res.is_err() {
107+
*self.trace_func.borrow_mut() = self.ctx.none();
108+
}
107109
}
108110

109111
if !self.is_none(&profile_func) {
110112
self.use_tracing.set(false);
111113
let res = profile_func.call(args, self);
112114
self.use_tracing.set(true);
113-
res?;
115+
if res.is_err() {
116+
*self.profile_func.borrow_mut() = self.ctx.none();
117+
}
114118
}
115119
Ok(())
116120
}

0 commit comments

Comments
 (0)