-
Notifications
You must be signed in to change notification settings - Fork 1.7k
No way to globally capture exceptions #8875
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
cc @tomball. |
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. |
Issue #8417 has been merged into this issue. cc @sigmundch. |
Issue #9273 has some details on work that happened to enable the VM to do this. Set owner to @floitschG. |
Removed Priority-Medium label. |
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. |
Any updates on this? |
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. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
We now have |
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!
The text was updated successfully, but these errors were encountered: