| OLD | NEW |
| 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 error_group; | 5 library pub.error_group; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'utils.dart'; | 9 import 'utils.dart'; |
| 10 | 10 |
| 11 /// An [ErrorGroup] entangles the errors of multiple [Future]s and [Stream]s | 11 /// An [ErrorGroup] entangles the errors of multiple [Future]s and [Stream]s |
| 12 /// with one another. This allows APIs to expose multiple [Future]s and | 12 /// with one another. This allows APIs to expose multiple [Future]s and |
| 13 /// [Stream]s that have identical error conditions without forcing API consumers | 13 /// [Stream]s that have identical error conditions without forcing API consumers |
| 14 /// to attach error handling to objects they don't care about. | 14 /// to attach error handling to objects they don't care about. |
| 15 /// | 15 /// |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 void _signalError(var e) { | 268 void _signalError(var e) { |
| 269 if (_isDone) return; | 269 if (_isDone) return; |
| 270 _subscription.cancel(); | 270 _subscription.cancel(); |
| 271 // Call these asynchronously to work around issue 7913. | 271 // Call these asynchronously to work around issue 7913. |
| 272 new Future.value().then((_) { | 272 new Future.value().then((_) { |
| 273 _controller.addError(e); | 273 _controller.addError(e); |
| 274 _controller.close(); | 274 _controller.close(); |
| 275 }); | 275 }); |
| 276 } | 276 } |
| 277 } | 277 } |
| OLD | NEW |