Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Issue 11225017: Improvement on future: add stack trace to future failures. (Closed)

Created:
8 years, 2 months ago by Siggi Cherem (dart-lang)
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Improvement on future: add stack trace to future failures. Committed: https://code.google.com/p/dart/source/detail?r=13849

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -11 lines) Patch
M lib/core/future.dart View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
M lib/coreimpl/future_implementation.dart View 1 3 chunks +3 lines, -3 lines 0 comments Download
M tests/corelib/future_test.dart View 8 chunks +8 lines, -8 lines 3 comments Download

Messages

Total messages: 8 (0 generated)
Siggi Cherem (dart-lang)
Basically Instead of seeing this: Unhandled exception: type 'String' is not a subtype of type ...
8 years, 2 months ago (2012-10-19 22:58:19 UTC) #1
Siggi Cherem (dart-lang)
8 years, 2 months ago (2012-10-19 23:37:45 UTC) #2
Jennifer Messerly
fwiw, lgtm https://codereview.chromium.org/11225017/diff/2001/lib/core/future.dart File lib/core/future.dart (right): https://codereview.chromium.org/11225017/diff/2001/lib/core/future.dart#newcode208 lib/core/future.dart:208: FutureUnhandledException(this.source, this.stackTrace); nit: newline after this https://codereview.chromium.org/11225017/diff/2001/lib/core/future.dart#newcode209 ...
8 years, 2 months ago (2012-10-19 23:54:15 UTC) #3
Siggi Cherem (dart-lang)
thanks, done. Submitting!
8 years, 2 months ago (2012-10-20 00:22:51 UTC) #4
Bob Nystrom
https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart File tests/corelib/future_test.dart (right): https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart#newcode77 tests/corelib/future_test.dart:77: Expect.throws(() => future.value, (e) => e.source == exception); I'm ...
8 years, 2 months ago (2012-10-22 16:57:49 UTC) #5
Siggi Cherem (dart-lang)
https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart File tests/corelib/future_test.dart (right): https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart#newcode77 tests/corelib/future_test.dart:77: Expect.throws(() => future.value, (e) => e.source == exception); On ...
8 years, 2 months ago (2012-10-22 17:23:54 UTC) #6
Jennifer Messerly
https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart File tests/corelib/future_test.dart (right): https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test.dart#newcode77 tests/corelib/future_test.dart:77: Expect.throws(() => future.value, (e) => e.source == exception); On ...
8 years, 2 months ago (2012-10-22 20:51:25 UTC) #7
Bob Nystrom
8 years, 2 months ago (2012-10-22 22:34:18 UTC) #8
On 2012/10/22 20:51:25, John Messerly wrote:
>
https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test....
> File tests/corelib/future_test.dart (right):
> 
>
https://codereview.chromium.org/11225017/diff/7001/tests/corelib/future_test....
> tests/corelib/future_test.dart:77: Expect.throws(() => future.value, (e) =>
> e.source == exception);
> On 2012/10/22 17:23:54, Siggi Cherem (dart-lang) wrote:
> > On 2012/10/22 16:57:49, Bob Nystrom wrote:
> > > I'm all for better error messages in future, but I'm a little worried
about
> > > this.
> > > 
> > > Does this mean that code that handles an exception from a future will
always
> > > receive the wrapped error and not the original one? Is this documented
> > > somewhere?
> > 
> > The wrapping will only happen when the exception is thrown in the open. The
> > exception manipulation functions, like 'handleException' or
> > 'transformException', will continue to work the same as before.
> 
> Yeah, I think the idea is: if you handle the exception in your future, you get
> the original exception object.
> 
> If you *do not* handle the exception, you get it at completion time. So
wrapping
> it is okay, because the code that completes the future wouldn't be able to
> handle the exception anyway. The future-completion code is trying to send the
> exception to the receiver of the future, but nobody is listening for
exceptions.
> So wrapping it and throwing it all the way up the call stack to the top level
> handler makes sense.
> 
> At least, that's how I justified it in my mind when I read the CL the first
time
> :)

Ah, now I get it. So you only get the wrapped exception when then() does a real
throw because no exception handlers are attached?

In that case, this sounds good. Though that fact should be documented.

Powered by Google App Engine
This is Rietveld 408576698