Wasmtime
|
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_t > | code () 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 |
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.
|
inline |
Returns the trace of WebAssembly frames associated with this trap.
Note that the trace
cannot outlive this error object.