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

Exception value from vm.Run #196

Open
ydnax opened this issue May 18, 2016 · 1 comment
Open

Exception value from vm.Run #196

ydnax opened this issue May 18, 2016 · 1 comment

Comments

@ydnax
Copy link

ydnax commented May 18, 2016

I am looking for a way to get the actual exception value thrown from js code in otto.Run. Currently the exception is converted to a errors.errorString. This way throw {foo:"bar"} becomes [object Object] and rethrowing the exception from js->go -> js via panic is not caught in the first level of js as the panic value is not a otto.Value.

My current workaround is calling my actual js code in a try-catch that returns a object with either {error:exception} or {ok:value} but a cleaner solution would be appreciated.

@stevenh
Copy link
Collaborator

stevenh commented Nov 28, 2022

Do you have a simple test example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants