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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 331593012: Add a "global activate" command to pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index 24c9ecfc76ed0d6f42d327540f52cd139e2ab65e..1c447c24142ddbb342cd40c55ce57f25d24f3d9c 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -819,3 +819,11 @@ void fail(String message, [innerError, StackTrace innerTrace]) {
throw new ApplicationException(message);
}
}
+
+/// Throw a [DataException] with [message] to indicate that the command has
+/// failed because of invalid input data.
+///
+/// This will report the error and cause pub to exit with [exit_codes.DATA].
+void dataError(String message) {
+ throw new DataException(message);
nweiz 2014/06/26 22:43:26 Is this really worth having a custom function for?
Bob Nystrom 2014/06/27 00:30:23 I like having it mainly because it mirrors usageEr
nweiz 2014/06/30 19:42:28 I don't think this parallel will be clear to peopl
Bob Nystrom 2014/06/30 20:36:01 In a later patch, usageError() ends up getting mov
+}

Powered by Google App Engine
This is Rietveld 408576698