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 re-throw errors with a stack trace #3974

Closed
nex3 opened this issue Jul 3, 2012 · 5 comments
Closed

No way to re-throw errors with a stack trace #3974

nex3 opened this issue Jul 3, 2012 · 5 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report

Comments

@nex3
Copy link
Member

nex3 commented Jul 3, 2012

When working with asynchronous code, and Futures in particular, you often end up with an exception object and its stack trace outside of the catch block where the exception was originally caught. Currently, there's no way to throw that exception so that when it's caught, the catcher sees the original stack trace rather than the trace of where the exception is re-thrown.

This is one of several issues that makes it extremely difficult to debug asynchronous code in Dart.

@nex3
Copy link
Member Author

nex3 commented Jul 3, 2012

Issue #2763 has been merged into this issue.


cc @sigmundch.

@gbracha
Copy link
Contributor

gbracha commented Jul 12, 2012

Added Duplicate label.
Marked as being merged into #4046.

@gbracha
Copy link
Contributor

gbracha commented Jul 12, 2012

Marked as being merged into #4061.

@DartBot
Copy link

DartBot commented Aug 6, 2012

This comment was originally written by zh...@gmail.com


Do we have a reason why it is bad to include the getStackTrace() method on Exception object? I agree that debugging heavy async code in dart is not fun at all.

@nex3
Copy link
Member Author

nex3 commented Aug 6, 2012

I believe the idea is that it's expensive to gather the stack trace for an exception, and that gathering must happen when the exception is thrown. Declaring in the catch clause whether a stack trace is needed allows it to only be collected when necessary.


Marked as being merged into #4061.

@nex3 nex3 added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Aug 6, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

3 participants