Wasmtime
wasmtime::Trap Class Reference

Information about a WebAssembly trap. More...

#include <trap.hh>

Public Member Functions

 Trap (std::string_view msg)
 Creates a new host-defined trap with the specified message.
 
std::string message () const
 Returns the descriptive message associated with this trap.
 
Trace trace () const
 
std::optional< wasmtime_trap_code_tcode () const
 Returns the trap code associated with this trap, or nothing if it was a manually created trap.
 

Friends

class Linker
 
class Instance
 
class Func
 
template<typename Params , typename Results >
class TypedFunc
 

Detailed Description

Information about a WebAssembly trap.

Traps can happen during normal wasm execution (such as the unreachable instruction) but they can also happen in host-provided functions to a host function can simulate raising a trap.

Traps have a message associated with them as well as a trace of WebAssembly frames on the stack.

Member Function Documentation

◆ trace()

Trace wasmtime::Trap::trace ( ) const
inline

Returns the trace of WebAssembly frames associated with this trap.

Note that the trace cannot outlive this error object.


The documentation for this class was generated from the following file: