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

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: Revise. 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);
+}

Powered by Google App Engine
This is Rietveld 408576698