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

Unified Diff: utils/pub/pub.dart

Issue 10911085: Emit a non-zero exit code when Pub fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | utils/tests/pub/pub_install_git_test.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 6db58c53619d6dffd6234365c233f14e12b4a355..0e4fe7281a1ddaf9f44b40eb554232e0b72c8545 100644
--- a/utils/pub/pub.dart
+++ b/utils/pub/pub.dart
@@ -184,8 +184,6 @@ class PubCommand {
handleError(error, trace) {
// This is basically the top-level exception handler so that we don't
// spew a stack trace on our users.
- // TODO(rnystrom): Add --trace flag so stack traces can be enabled for
- // debugging.
var message = error.toString();
// TODO(rnystrom): The default exception implementation class puts
@@ -198,7 +196,10 @@ class PubCommand {
if (globalOptions['trace'] && trace != null) {
printError(trace);
}
- return true;
+
+ // TODO(nweiz): Use the more semantic error codes in
+ // http://www.freebsd.org/cgi/man.cgi?query=sysexits
+ exit(1);
}
// TODO(rnystrom): Will eventually need better logic to walk up
@@ -218,6 +219,7 @@ class PubCommand {
}
});
future.handleException((e) => handleError(e, future.stackTrace));
+ future.then((_) => exit(0));
Bob Nystrom 2012/09/05 00:52:00 Can you add a comment here saying this is success
nweiz 2012/09/05 00:59:19 Done.
}
/**
« no previous file with comments | « no previous file | utils/tests/pub/pub_install_git_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698