Chromium Code Reviews| 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
|
| +} |