Index: utils/pub/command_uploader.dart |
diff --git a/utils/pub/command_uploader.dart b/utils/pub/command_uploader.dart |
index 618afc36f6d85c18435a742202e566bb332e5567..46b0ea0c6dd327864a5f7439856a446bdcb05e89 100644 |
--- a/utils/pub/command_uploader.dart |
+++ b/utils/pub/command_uploader.dart |
@@ -4,6 +4,7 @@ |
library command_uploader; |
+import 'dart:async'; |
import 'dart:io'; |
import 'dart:uri'; |
@@ -56,12 +57,12 @@ class UploaderCommand extends PubCommand { |
exit(exit_codes.USAGE); |
} |
- return new Future.immediate(null).chain((_) { |
+ return new Future.immediate(null).then((_) { |
var package = commandOptions['package']; |
if (package != null) return new Future.immediate(package); |
return Entrypoint.load(path.current, cache) |
- .transform((entrypoint) => entrypoint.root.name); |
- }).chain((package) { |
+ .then((entrypoint) => entrypoint.root.name); |
+ }).then((package) { |
var uploader = commandOptions.rest[0]; |
return oauth2.withClient(cache, (client) { |
if (command == 'add') { |
@@ -74,7 +75,7 @@ class UploaderCommand extends PubCommand { |
return client.delete(url); |
} |
}); |
- }).transform(handleJsonSuccess).transformException((e) { |
+ }).then(handleJsonSuccess).catchError((e) { |
if (e is! PubHttpException) throw e; |
handleJsonError(e.response); |
}); |