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

Unified Diff: utils/pub/hosted_source.dart

Issue 11830017: Fix ALL the pub tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698