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

Unified Diff: utils/pub/pub.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/io.dart ('k') | utils/pub/pubspec.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/pub.dart
diff --git a/utils/pub/pub.dart b/utils/pub/pub.dart
index 02269bbaeec1b1bccaf418d7187e203b83913019..4f1b632af545e6a3a719cce6bb34b005900e2566 100644
--- a/utils/pub/pub.dart
+++ b/utils/pub/pub.dart
@@ -259,11 +259,25 @@ abstract class PubCommand {
}
log.error(message);
- if (globalOptions['trace'] && trace != null) {
- log.error(trace);
+
+ if (trace != null) {
+ if (globalOptions['trace'] || !isUserFacingException(error)) {
+ log.error(trace);
+ } else {
+ log.fine(trace);
+ }
+ }
+
+ if (globalOptions['trace']) {
log.dumpTranscript();
- } else {
- log.fine(trace);
+ } else if (!isUserFacingException(error)) {
+ log.error("""
+This is an unexpected error. Please run
+
+ pub --trace ${new Options().arguments.map((arg) => "'$arg'").join(' ')}
+
+and include the results in a bug report on http://dartbug.com/new.
+""");
}
exit(_chooseExitCode(error));
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698