-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Need a global error handler primitive in dart2js. #9274
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Marked this as blocking #5958. |
Added some comments on what we want to issue #9273 (the VM counterpart of this bug). |
Added this to the Later milestone. |
Added TriageForM5 label. |
Removed TriageForM5 label. |
Set owner to @kasperl. |
This comment was originally written by @bjornm I cannot find a uniform way to catch all unhandled errors. I see unhandled errors arising in the following situations: a) inside main() The RootZone seems to be able to deal with some of these cases but it lacks documentation. I can't seem to be able to override the default behavior for unhandled errors? For now, I've resorted to listening to the window.addEventListener('error'). However, when the AsyncErrors bubble this far, the trace is lost due to wrapException(): Uncaught Illegal argument(s): foobar Instance of 'ErrorEvent' Error As a workaround I'm overriding dartPrint() so I can grab the original stackTrace written by the RootZone error handler for later processing. But it would be nice with a cleaner way to do this. |
The following should capture all errors. main() { We are also planning to provide other means to deal with uncaught errors, by sending control-messages to the isolate. |
Added Accepted label. |
Set owner to @floitschG. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
Zones is the solution to capturing errors. Added AssumedStale label. |
We need a way to set the global error-handler. For now just having a private dart2js specific implementation is good enough. We can then provide a public API on top of it.
Also see issue #9273 and issue #9012.
The text was updated successfully, but these errors were encountered: