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

Issue 11826050: Consider a thrown AsyncError from a future/stream handler a rethrow. (Closed)

Created:
7 years, 11 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 11 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Consider a thrown AsyncError from a future/stream handler a rethrow. The AsyncError is not wrapped, but is used directly as the async error. BUG=dartbug.com/7781 Committed: https://code.google.com/p/dart/source/detail?r=16950

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments. Add tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -21 lines) Patch
M sdk/lib/async/future.dart View 1 4 chunks +27 lines, -15 lines 0 comments Download
M sdk/lib/async/future_impl.dart View 1 7 chunks +31 lines, -4 lines 0 comments Download
M sdk/lib/async/stream.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/async/stream_controller.dart View 1 1 chunk +15 lines, -1 line 0 comments Download
M tests/lib/async/future_test.dart View 1 3 chunks +79 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-10 14:07:17 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart File sdk/lib/async/future.dart (right): https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart#newcode69 sdk/lib/async/future.dart:69: * as the error result, otherwise it's wrapped ...
7 years, 11 months ago (2013-01-10 16:38:10 UTC) #2
Bob Nystrom
On 2013/01/10 16:38:10, floitsch wrote: > LGTM. > > https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart > File sdk/lib/async/future.dart (right): > ...
7 years, 11 months ago (2013-01-10 18:30:15 UTC) #3
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-11 07:02:05 UTC) #4
Aww, Bob! :)
Tests added for future. 

Stream isn't actually changed, and I'm no longer convinced that it doesn't need
it.

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart
File sdk/lib/async/future.dart (right):

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart#new...
sdk/lib/async/future.dart:69: * as the error result, otherwise it's wrapped in
an [AsyncError] first.
On 2013/01/10 16:38:10, floitsch wrote:
> it is

Done.

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart#new...
sdk/lib/async/future.dart:92: * emitted by the returned Future unmodified.
Not really, no.

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/future.dart#new...
sdk/lib/async/future.dart:179: * Otherwise the [exception] and an optional
[stackTrace] is combined and sent
On 2013/01/10 16:38:10, floitsch wrote:
> .. is combined into an [AsyncError] and ...

Done.

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/stream_controll...
File sdk/lib/async/stream_controller.dart (right):

https://codereview.chromium.org/11826050/diff/1/sdk/lib/async/stream_controll...
sdk/lib/async/stream_controller.dart:89: * error object reported to listeners,
and the [stackTrace] is ignored.
On 2013/01/10 16:38:10, floitsch wrote:
> I would mention the special case after the normal case.
> Maybe:
> 
> If the [exception] is not an [AsyncError], combines the [exception] and the
> optional [stackTrace] into an [AsyncError] and sends the result to [this]
> stream's listeners.
> 
> If the [exception] is already an [AsyncError], then the [stackTrace] is
ignored
> and the [exception] is sent directly to the listeners.

Done.

Powered by Google App Engine
This is Rietveld 408576698