MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / unwrap_exception

Method unwrap_exception

crates/debugger/src/host/api.rs:996–1009  ·  view source on GitHub ↗
(
        &mut self,
        self_: Resource<WasmValue>,
    )

Source from the content-addressed store, hash-verified

994 }
995
996 async fn unwrap_exception(
997 &mut self,
998 self_: Resource<WasmValue>,
999 ) -> Result<Option<Resource<WasmException>>> {
1000 let value = self.get(&self_)?;
1001 match value {
1002 WasmValue::Exn(Some(e)) => {
1003 let e = e.clone();
1004 Ok(Some(self.push(WasmException(e))?))
1005 }
1006 WasmValue::Exn(None) => Ok(None),
1007 _ => wasmtime::bail!("Wasm value is not an exnref."),
1008 }
1009 }
1010
1011 async fn make_i32(&mut self, value: u32) -> Result<Resource<WasmValue>> {
1012 Ok(self.push(WasmValue::Primitive(Val::I32(value.cast_signed())))?)

Callers

nothing calls this directly

Calls 5

OkFunction · 0.85
WasmExceptionClass · 0.85
getMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected