[][src]Function wasmer_vm::raise_user_trap

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

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 wasmer_call and wasmer_call_trampoline below.

Safety

Only safe to call when wasm code is on the stack, aka wasmer_call or wasmer_call_trampoline must have been previously called.