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

Catch global errors from JS #58

Open
appsforartists opened this issue Mar 29, 2018 · 1 comment
Open

Catch global errors from JS #58

appsforartists opened this issue Mar 29, 2018 · 1 comment

Comments

@appsforartists
Copy link

Is it possible to register a global exception handler from within JS executed by CocoaScript?

In a typical environment, this can be done with addEventListener('error', …), but of course the global object doesn't have an addEventListener in a JSContext.

Peeking through the Mocha codebase, I didn't see an obvious place to do this. I see a setErrorController in your codebase, but it looks like that's being used in a REPL, not in the runtime itself.

@appsforartists
Copy link
Author

Maybe the fiber API could have a way to trigger a callback when an error occurs while that fiber is active.

afedor pushed a commit to afedor/CocoaScript that referenced this issue Dec 20, 2020
Code Review: Improve how errors are logged (#24206)
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