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

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

Issue 49293003: Report wrapped pub exceptions with --verbose and --trace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 7 years, 1 month 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 | « sdk/lib/_internal/pub/lib/src/solver/version_solver.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/source/hosted.dart
diff --git a/sdk/lib/_internal/pub/lib/src/source/hosted.dart b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
index 8e4a95dc53ebb2a89f772bc28c74a0052c86ec6f..265c844422432a9fc63cea69bb5826f8ab746f07 100644
--- a/sdk/lib/_internal/pub/lib/src/source/hosted.dart
+++ b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
@@ -50,9 +50,9 @@ class HostedSource extends Source {
return doc['versions']
.map((version) => new Version.parse(version['version']))
.toList();
- }).catchError((ex) {
+ }).catchError((ex, stackTrace) {
var parsed = _parseDescription(description);
- _throwFriendlyError(ex, parsed.first, parsed.last);
+ _throwFriendlyError(ex, stackTrace, parsed.first, parsed.last);
});
}
@@ -73,9 +73,9 @@ class HostedSource extends Source {
// been downloaded.
return new Pubspec.fromMap(version['pubspec'], systemCache.sources,
expectedName: id.name, location: url);
- }).catchError((ex) {
+ }).catchError((ex, stackTrace) {
var parsed = _parseDescription(id.description);
- _throwFriendlyError(ex, id, parsed.last);
+ _throwFriendlyError(ex, stackTrace, id, parsed.last);
});
}
@@ -155,19 +155,21 @@ 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(error, package, url) {
+ void _throwFriendlyError(error, StackTrace stackTrace, String package,
+ String url) {
if (error is PubHttpException &&
error.response.statusCode == 404) {
- fail('Could not find package "$package" at $url.');
+ fail('Could not find package "$package" at $url.', error, stackTrace);
}
if (error is TimeoutException) {
- fail('Timed out trying to find package "$package" at $url.');
+ fail('Timed out trying to find package "$package" at $url.',
+ error, stackTrace);
}
if (error is io.SocketException) {
- fail('Got socket error trying to find package "$package" at $url.\n'
- '$error');
+ fail('Got socket error trying to find package "$package" at $url.',
+ error, stackTrace);
}
// Otherwise re-throw the original exception.
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/version_solver.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698