Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript exception being swallowed? #109

Closed
bhelx opened this issue Dec 2, 2024 · 1 comment · Fixed by #113
Closed

JavaScript exception being swallowed? #109

bhelx opened this issue Dec 2, 2024 · 1 comment · Fixed by #113

Comments

@bhelx
Copy link
Contributor

bhelx commented Dec 2, 2024

As of v1.3.0, when the js code throws an exception it seems to be getting swallowed by some top-level trap:

$ cat examples/exception/script.js

function greet() {
  throw new Error("I am a JS exception")
}
module.exports = { greet };

$ extism call examples/exception.wasm greet --input="Hello" --wasi
Error: Exception generated by QuickJS
returned non-zero exit code: 4294967295

This exit code a bit bizarre also. I suspect this might be related to the rquickjs refactor but not sure. When we do figure it out we need to add a test for this.

@bhelx
Copy link
Contributor Author

bhelx commented Dec 2, 2024

I think i found where the exception is originating from at least:

https://github.com/DelSkayn/rquickjs/blob/6d8f612636c1a6d4b4acd7a78ce30063666a1b78/core/src/result.rs#L530

Maybe we need to refactor the error handling code.

@bhelx bhelx changed the title Exception being swallowed? JavaScript exception being swallowed? Dec 2, 2024
bhelx added a commit that referenced this issue Dec 4, 2024
Fixes #109

Just a test to repro for now. I tried to upgrade quickjs. Did some other
house cleaning while in here. It appears that the problem may be in
rquickjs, but maybe we are holding it wrong. Will look with Zach today.
@bhelx bhelx closed this as completed in 0967fba Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant