extism / js-pdk

Write Extism plugins in JavaScript & TypeScript
42 stars 16 forks source link

Regression bug when exception is thrown #58

Closed bhelx closed 3 months ago

bhelx commented 3 months ago

There seems to be a regression around the core engine handling exceptions. Given this test program:

function greet() {
  throw new Error('hello')
}

module.exports = { greet }

Output is:

2024/03/23 09:33:11 No runtime detected
2024/03/23 09:33:11 Calling function : greet
Error: wasm error: unreachable
wasm stack trace:
    .$1151(i32,i32,i32,i32,i32,i32)
    .$1290(i32,i32)
    .$1309(i32,i32,i32,i32,i32)
    .$1357(i32) i32
    .$1374() i32

We should see the exception

bhelx commented 3 months ago

Should be fixed in #57