tessi / wasmex

Execute WebAssembly from Elixir
MIT License
561 stars 32 forks source link

add wasmtime trap information on function call errors, if available #620

Open tessi opened 3 months ago

tessi commented 3 months ago

Function call errors into web assembly now have more detail if wasmtimes trap information is available. This helps, for example, when using fuel and the wasmtime store is out of fuel:

Error during function excecution (wasm trap: all fuel consumed by WebAssembly): error while executing at wasm backtrace:
    0: 0x3618 - wasmex_test.wasm!void

The new information is added in parenthesis just after the Error during function excecution message.

See: #617

superchris commented 1 day ago

This seems really nice! I might like to do something very similar in the components code, turning traps (eg when wasi is needed but not present) into proper error tuples would be lovely