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

No way to globally capture exceptions #8875

Closed
sethladd opened this issue Mar 1, 2013 · 14 comments
Closed

No way to globally capture exceptions #8875

sethladd opened this issue Mar 1, 2013 · 14 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@sethladd
Copy link
Contributor

sethladd commented Mar 1, 2013

I would like a way to register a global exception handler, to capture exceptions that my code fails to catch. This can prevent my program from exiting due to buggy 3rd party libraries, misused Timers, or other unexpected circumstances.

Thanks!

@sethladd
Copy link
Contributor Author

sethladd commented Mar 1, 2013

cc @tomball.

@DartBot
Copy link

DartBot commented Mar 4, 2013

This comment was originally written by @tomyeh


+1 Global exception handling is important for asynchronous programming. However, the more challenging one is how to carry the context to the handler. For example, if the exception happens when serving a HTTP request, we have to close the connection in the handler.

Not sure there is an elegant way for doing it. Future.catchError is a good solution, thought not global. But, to apply it, it means Stream, Timer and all async invokers have to implement catchError.

@sethladd
Copy link
Contributor Author

sethladd commented Mar 6, 2013

Issue #8417 has been merged into this issue.


cc @sigmundch.
cc @jmesserly.
cc @gbracha.

@dgrove
Copy link
Contributor

dgrove commented Apr 27, 2013

Issue #9273 has some details on work that happened to enable the VM to do this.


Set owner to @floitschG.
Added C1 label.

@dgrove
Copy link
Contributor

dgrove commented Apr 27, 2013

Removed Priority-Medium label.
Added Priority-High label.

@floitschG
Copy link
Contributor

Probably won't make it into M5, but until then we should have a way to capture uncaught exceptions in a scoped way. You could then just put this into the main.


Added this to the M6 milestone.

@larsbak
Copy link

larsbak commented Aug 27, 2013

Removed this from the M6 milestone.
Added this to the M7 milestone.

@madsager
Copy link
Contributor

Removed this from the M7 milestone.
Added this to the M8 milestone.

@dgrove
Copy link
Contributor

dgrove commented Oct 22, 2013

Any updates on this?

@floitschG
Copy link
Contributor

If I'm not wrong this should now be possible by wrapping the code in main into a zone.

Lowering priorit, but not closing yet, since we are investigating other means to make top-level errors non-fatal.


Removed Priority-High label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M8 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@sethladd sethladd added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@lrhn
Copy link
Member

lrhn commented Aug 11, 2017

We now have Isolate.current.addErrorListener and Isolate.current.setErrorsFatal along with the Zone based solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

9 participants