wasmer_vm

Function raise_user_trap

Source
pub unsafe fn raise_user_trap(data: Box<dyn Error + Send + Sync>) -> !
Expand description

Raises a user-defined trap immediately.

This function performs as-if a wasm trap was just executed, only the trap has a dynamic payload associated with it which is user-provided. This trap payload is then returned from catch_traps below.

ยงSafety

Only safe to call when wasm code is on the stack, aka catch_traps must have been previous called and not yet returned. Additionally no Rust destructors may be on the stack. They will be skipped and not executed.