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

Unified Diff: utils/pub/hosted_source.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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
« no previous file with comments | « utils/pub/error_group.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/hosted_source.dart
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index 0ed4e0c080bb20219dcfeae01d21e624ddfae385..5f63ec3ea1b15d095a5050b782c3d441bfa2289f 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -130,23 +130,23 @@ 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(AsyncError asyncError, package, url) {
- if (asyncError.error is PubHttpException &&
- asyncError.error.response.statusCode == 404) {
+ void _throwFriendlyError(error, package, url) {
+ if (error is PubHttpException &&
+ error.response.statusCode == 404) {
throw 'Could not find package "$package" at $url.';
}
- if (asyncError.error is TimeoutException) {
+ if (error is TimeoutException) {
throw 'Timed out trying to find package "$package" at $url.';
}
- if (asyncError.error is io.SocketIOException) {
+ if (error is io.SocketIOException) {
throw 'Got socket error trying to find package "$package" at $url.\n'
- '${asyncError.error.osError}';
+ '${error.osError}';
}
// Otherwise re-throw the original exception.
- throw asyncError;
+ throw error;
}
}
« no previous file with comments | « utils/pub/error_group.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698