Index: utils/pub/utils.dart |
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart |
index 9094984adcf3d37cd926fc35546b61e243c9a735..2a800fa0ce59bd7d67e824321d220fcc218fbd20 100644 |
--- a/utils/pub/utils.dart |
+++ b/utils/pub/utils.dart |
@@ -120,11 +120,8 @@ Future sleep(int milliseconds) { |
/// Configures [future] so that its result (success or exception) is passed on |
/// to [completer]. |
void chainToCompleter(Future future, Completer completer) { |
- future |
- .then(completer.complete) |
- .catchError((e) { |
- completer.completeError(e.error, e.stackTrace); |
- }); |
+ future.then((value) => completer.complete(value), |
+ onError: (e) => completer.completeError(e.error, e.stackTrace)); |
} |
// TODO(nweiz): unify the following functions with the utility functions in |