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

Unified Diff: utils/pub/hosted_source.dart

Issue 14253005: Migrate pub away from throwing strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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/entrypoint.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 5a4106e29cac657b57ea2dafe8abcf349f93223c..bd017e667a61f48e912f40600dcbede85071d10a 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -133,16 +133,16 @@ class HostedSource extends Source {
void _throwFriendlyError(error, package, url) {
if (error is PubHttpException &&
error.response.statusCode == 404) {
- throw 'Could not find package "$package" at $url.';
+ fail('Could not find package "$package" at $url.');
}
if (error is TimeoutException) {
- throw 'Timed out trying to find package "$package" at $url.';
+ fail('Timed out trying to find package "$package" at $url.');
}
if (error is io.SocketIOException) {
- throw 'Got socket error trying to find package "$package" at $url.\n'
- '${error.osError}';
+ fail('Got socket error trying to find package "$package" at $url.\n'
+ '${error.osError}');
}
// Otherwise re-throw the original exception.
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698