MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / inject_host_error_by_id

Method inject_host_error_by_id

compiler/src/modules/vm/init.rs:123–128  ·  view source on GitHub ↗

Raise `e` inside the `WaitingHostCall(id)` coro at its saved try-frame, or mark it Errored if none; false if no coro is parked on `id`. A failed host call wakes only its coro, leaving siblings untouched. */

(&mut self, id: u64, e: VmErr)

Source from the content-addressed store, hash-verified

121
122 /* Raise `e` inside the `WaitingHostCall(id)` coro at its saved try-frame, or mark it Errored if none; false if no coro is parked on `id`. A failed host call wakes only its coro, leaving siblings untouched. */
123 pub fn inject_host_error_by_id(&mut self, id: u64, e: VmErr) -> bool {
124 let Some(idx) = self.scheduler.iter().position(|h| matches!(h.state, CoroState::WaitingHostCall(w) if w == id)) else { return false; };
125 let coro = self.scheduler[idx].coro;
126 self.scheduler[idx].state = self.raise_into_outer(coro, e);
127 true
128 }
129
130 /* Test/host helper: raise a generic error (`VmErr::Raised(message)`) into host call `id`. */
131 pub fn push_host_error_by_id(&mut self, id: u64, message: &str) -> bool {

Callers 2

push_host_error_by_idMethod · 0.80
set_host_error_by_idFunction · 0.80

Calls 2

raise_into_outerMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected