Index: utils/pub/http.dart |
diff --git a/utils/pub/http.dart b/utils/pub/http.dart |
index dadc4b12959399b5f915a70e2db97d9ad34f5154..8df0575fe0a8084d14c41e73e954945d7484cb50 100644 |
--- a/utils/pub/http.dart |
+++ b/utils/pub/http.dart |
@@ -61,21 +61,21 @@ class PubHttpClient extends http.BaseClient { |
return http.Response.fromStream(streamedResponse).then((response) { |
throw new PubHttpException(response); |
}); |
- }).catchError((asyncError) { |
- if (asyncError.error is SocketIOException && |
- asyncError.error.osError != null) { |
- if (asyncError.error.osError.errorCode == 8 || |
- asyncError.error.osError.errorCode == -2 || |
- asyncError.error.osError.errorCode == -5 || |
- asyncError.error.osError.errorCode == 11001 || |
- asyncError.error.osError.errorCode == 11004) { |
+ }).catchError((error) { |
+ if (error is SocketIOException && |
+ error.osError != null) { |
+ if (error.osError.errorCode == 8 || |
+ error.osError.errorCode == -2 || |
+ error.osError.errorCode == -5 || |
+ error.osError.errorCode == 11001 || |
+ error.osError.errorCode == 11004) { |
throw 'Could not resolve URL "${request.url.origin}".'; |
- } else if (asyncError.error.osError.errorCode == -12276) { |
+ } else if (error.osError.errorCode == -12276) { |
throw 'Unable to validate SSL certificate for ' |
'"${request.url.origin}".'; |
} |
} |
- throw asyncError; |
+ throw error; |
}), HTTP_TIMEOUT, 'fetching URL "${request.url}"'); |
} |