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

How to Throw an Error From the Golang Function #563

Open
gastraight opened this issue Mar 24, 2024 · 0 comments
Open

How to Throw an Error From the Golang Function #563

gastraight opened this issue Mar 24, 2024 · 0 comments

Comments

@gastraight
Copy link

Hi!
While injecting a golang function into a js runtime how to throw an error js way within this function
e.g.

	runtime := goja.New()
	runtime.Set("aFunc", func() {
               // how to throw an error here
        })
        runtime.RunString(`
              try {
                  aFunc()
              } catch (error) {
                  // so that to be able to catch it over here 
             }
        `)

Thx.

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

No branches or pull requests

1 participant