Currently, unless I'm mistaken, we'll have to check the wasmtime.Trap's Message() to figure out what happened.
While there could be user-defined traps, there seem to be a bunch of pre-defined ones in wasmtime:
https://github.com/bytecodealliance/wasmtime/blob/bde955579336e124b2c01b3164314bf2d6eec378/cranelift/codegen/src/ir/trapcode.rs#L8-L54
It would be nice if these were exposed to Go, allowing for use with errors.Is() or errors.As(), instead of inspecting the message string.
Currently, unless I'm mistaken, we'll have to check the
wasmtime.Trap'sMessage()to figure out what happened.While there could be user-defined traps, there seem to be a bunch of pre-defined ones in wasmtime:
https://github.com/bytecodealliance/wasmtime/blob/bde955579336e124b2c01b3164314bf2d6eec378/cranelift/codegen/src/ir/trapcode.rs#L8-L54
It would be nice if these were exposed to Go, allowing for use with
errors.Is()orerrors.As(), instead of inspecting the message string.