Index: utils/pub/hosted_source.dart |
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart |
index 70b1440d297f093da1e20b8aad333f857786939e..073f8232a05a94f15e5014d7e563d73a37bfd170 100644 |
--- a/utils/pub/hosted_source.dart |
+++ b/utils/pub/hosted_source.dart |
@@ -78,7 +78,8 @@ class HostedSource extends Source { |
systemCache.createTempDir() |
]).then((args) { |
tempDir = args[1]; |
- return timeout(extractTarGz(args[0], tempDir), HTTP_TIMEOUT, |
+ var stream = wrapByteStream(args[0]); |
+ return timeout(extractTarGz(stream, tempDir), HTTP_TIMEOUT, |
'fetching URL "$fullUrl"'); |
}).then((_) { |
// Now that the install has succeeded, move it to the real location in |
@@ -118,8 +119,8 @@ class HostedSource extends Source { |
/// When an error occurs trying to read something about [package] from [url], |
/// this tries to translate into a more user friendly error message. Always |
/// throws an error, either the original one or a better one. |
- void _throwFriendlyError(ex, package, url) { |
- ex = getRealError(ex); |
+ void _throwFriendlyError(asyncError, package, url) { |
Bob Nystrom
2013/01/09 16:49:23
Can we type annotate this too?
|
+ var ex = getRealError(asyncError); |
if (ex is PubHttpException && ex.response.statusCode == 404) { |
throw 'Could not find package "$package" at $url.'; |
@@ -135,7 +136,7 @@ class HostedSource extends Source { |
} |
// Otherwise re-throw the original exception. |
- throw ex; |
+ throw asyncError; |
Bob Nystrom
2013/01/09 16:49:23
Argh good catch. Completely misleading comment on
|
} |
/// Parses the description for a package. |