Skip to content

Catch global errors from JS #58

Open

Description

@appsforartists

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.

Activity

  1. appsforartists commented on Mar 29, 2018

    @appsforartists
    Author

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

  2. added a commit that references this issue on Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions