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

Unified Diff: utils/pub/hosted_source.dart

Issue 11881032: Stop working around issue 7781 in Pub. (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
« no previous file with comments | « utils/pub/command_uploader.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 28bb1611d6712c5213381ab8babf36274440db71..3ae7c5581f886303b65ba2f393d42e83928cb926 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -120,19 +120,18 @@ class HostedSource extends Source {
/// 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) {
- var ex = getRealError(asyncError);
-
- if (ex is PubHttpException && ex.response.statusCode == 404) {
+ if (asyncError.error is PubHttpException &&
+ asyncError.error.response.statusCode == 404) {
throw 'Could not find package "$package" at $url.';
}
- if (ex is TimeoutException) {
+ if (asyncError.error is TimeoutException) {
throw 'Timed out trying to find package "$package" at $url.';
}
- if (ex is io.SocketIOException) {
+ if (asyncError.error is io.SocketIOException) {
throw 'Got socket error trying to find package "$package" at $url.\n'
- '${ex.osError}';
+ '${asyncError.error.osError}';
}
// Otherwise re-throw the original exception.
« no previous file with comments | « utils/pub/command_uploader.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698