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

Side by Side Diff: pkg/scheduled_test/lib/src/future_group.dart

Issue 68493003: Ensure that errors have stack traces attached. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library future_group; 5 library future_group;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 /// A completer that waits until all added [Future]s complete. 9 /// A completer that waits until all added [Future]s complete.
10 // TODO(rnystrom): Copied from web_components. Remove from here when it gets 10 // TODO(rnystrom): Copied from web_components. Remove from here when it gets
(...skipping 16 matching lines...) Expand all
27 futures.add(task.then((value) { 27 futures.add(task.then((value) {
28 if (completed) return; 28 if (completed) return;
29 29
30 _pending--; 30 _pending--;
31 _values.add(value); 31 _values.add(value);
32 32
33 if (_pending <= 0) { 33 if (_pending <= 0) {
34 completed = true; 34 completed = true;
35 _completer.complete(_values); 35 _completer.complete(_values);
36 } 36 }
37 }).catchError((error) { 37 }).catchError((error, stackTrace) {
38 if (completed) return; 38 if (completed) return;
39 39
40 completed = true; 40 completed = true;
41 _completer.completeError(error); 41 _completer.completeError(error, stackTrace);
42 })); 42 }));
43 43
44 return task; 44 return task;
45 } 45 }
46 46
47 Future<List> get future => _completer.future; 47 Future<List> get future => _completer.future;
48 } 48 }
49 49
OLDNEW
« no previous file with comments | « pkg/http/test/safe_http_server.dart ('k') | pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698