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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/source/hosted.dart

Issue 19792005: Print entire SocketException in pub, to help debug the problem. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.source.hosted; 5 library pub.source.hosted;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 import 'dart:json' as json; 9 import 'dart:json' as json;
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 error.response.statusCode == 404) { 160 error.response.statusCode == 404) {
161 fail('Could not find package "$package" at $url.'); 161 fail('Could not find package "$package" at $url.');
162 } 162 }
163 163
164 if (error is TimeoutException) { 164 if (error is TimeoutException) {
165 fail('Timed out trying to find package "$package" at $url.'); 165 fail('Timed out trying to find package "$package" at $url.');
166 } 166 }
167 167
168 if (error is io.SocketException) { 168 if (error is io.SocketException) {
169 fail('Got socket error trying to find package "$package" at $url.\n' 169 fail('Got socket error trying to find package "$package" at $url.\n'
170 '${error.osError}'); 170 '$error');
171 } 171 }
172 172
173 // Otherwise re-throw the original exception. 173 // Otherwise re-throw the original exception.
174 throw error; 174 throw error;
175 } 175 }
176 } 176 }
177 177
178 /// This is the modified hosted source used when pub install or update are run 178 /// This is the modified hosted source used when pub install or update are run
179 /// with "--offline". This uses the system cache to get the list of available 179 /// with "--offline". This uses the system cache to get the list of available
180 /// packages and does no network access. 180 /// packages and does no network access.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 var name = description["name"]; 262 var name = description["name"];
263 if (name is! String) { 263 if (name is! String) {
264 throw new FormatException("The 'name' key must have a string value."); 264 throw new FormatException("The 'name' key must have a string value.");
265 } 265 }
266 266
267 var url = description["url"]; 267 var url = description["url"];
268 if (url == null) url = HostedSource.defaultUrl; 268 if (url == null) url = HostedSource.defaultUrl;
269 269
270 return new Pair<String, String>(name, url); 270 return new Pair<String, String>(name, url);
271 } 271 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698