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

Issue 68523005: Make Future.wait have an eagerError option that defaults to false. (Closed)

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

Description

Make Future.wait have an eagerError option that defaults to false. This means that Future.wait will, by default, wait for all futures to complete, even if there is an error. All but the first error are dropped, and the future completes with the first error. If eagerError is set to true, the returned future completes immediately on the first error. BUG= http://dartbug.com/14794 R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=30443

Patch Set 1 #

Patch Set 2 : Combine two versions. Improve error handling. #

Total comments: 8

Patch Set 3 : More tests. #

Patch Set 4 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -17 lines) Patch
M sdk/lib/async/future.dart View 1 2 3 1 chunk +33 lines, -16 lines 0 comments Download
M tests/lib/async/futures_test.dart View 1 2 3 3 chunks +55 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
7 years, 1 month ago (2013-11-12 07:11:05 UTC) #1
floitsch
As discussed. Let's try to keep the code smaller.
7 years, 1 month ago (2013-11-18 13:16:54 UTC) #2
Lasse Reichstein Nielsen
PTAL
7 years, 1 month ago (2013-11-19 07:24:30 UTC) #3
floitsch
LGTM. https://codereview.chromium.org/68523005/diff/50001/sdk/lib/async/future.dart File sdk/lib/async/future.dart (right): https://codereview.chromium.org/68523005/diff/50001/sdk/lib/async/future.dart#newcode228 sdk/lib/async/future.dart:228: void handleError(theError, theStackTrace) { I'm not sure if ...
7 years, 1 month ago (2013-11-19 10:50:33 UTC) #4
Lasse Reichstein Nielsen
Committed patchset #4 manually as r30443 (presubmit successful).
7 years, 1 month ago (2013-11-20 09:28:59 UTC) #5
Lasse Reichstein Nielsen
7 years, 1 month ago (2013-11-20 09:29:28 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/68523005/diff/50001/sdk/lib/async/future.dart
File sdk/lib/async/future.dart (right):

https://codereview.chromium.org/68523005/diff/50001/sdk/lib/async/future.dart...
sdk/lib/async/future.dart:228: void handleError(theError, theStackTrace) {
Good point, will remove the void.

https://codereview.chromium.org/68523005/diff/50001/tests/lib/async/futures_t...
File tests/lib/async/futures_test.dart (right):

https://codereview.chromium.org/68523005/diff/50001/tests/lib/async/futures_t...
tests/lib/async/futures_test.dart:122: Future testEagerWait() {
Whoops. Fixed.

https://codereview.chromium.org/68523005/diff/50001/tests/lib/async/futures_t...
tests/lib/async/futures_test.dart:128: onError: (e, s) {
Will do.

https://codereview.chromium.org/68523005/diff/50001/tests/lib/async/futures_t...
tests/lib/async/futures_test.dart:130: returntrue;
Quite obvious that it isn't called too. :(

Powered by Google App Engine
This is Rietveld 408576698