Function hdk::prelude::return_err_ptr
source · pub fn return_err_ptr(wasm_error: WasmError) -> u128
Expand description
Convert a WasmError
to a GuestPtrLen
as best we can. This is not
necessarily straightforward as the serialization process can error recursively.
In the worst case we can’t even serialize an enum variant, in which case we panic.
The casts from usize
to u32
are safe as long as the guest code is compiled
for wasm32-unknown-unknown
target.