-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Need a way to trap exceptions that reach top-level #8442
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
Comments
The spec already notes: If an uncaught exception is thrown by a running isolate A, A is immediately suspended. Not terminated, suspended. The non-normative text describes the relation to the embedder, which should get a description of the exception (this is described for compilation errors). It's possible we should make some this text normative and clarify that it applies to uncaught exceptions. Ultimately, this is the easy part. The key thing is the SMOP, and it seems clear to me that the embedder should deal with this situation. Unless you want resumable exceptions, I don't see why the language runtime would need to do very much. |
I don't think "suspended" is the desired behavior for the main browser isolate. The Dartium embedder can't do anything here, because it doesn't know how to talk to web server. This must be handled by application's code. We would like the application to register a handler that can respond to the exception and deal with it. The case we are concerned with is an exception in the main isolate, such as in an event handler, requestAnimationFrame, setTimeout, etc. It is not always possible to ensure a try-catch on every event handler. |
I think this is a duplicate of issue #8417. |
(fixed dup reference) Marked as being merged into #8417. |
In the browser, it's important to have a way to catch top-level exceptions so that they can be logged to servers.
Not sure if this will wind up being an embedder issue or a language issue.
The text was updated successfully, but these errors were encountered: