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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Generic utility functions. Stuff that should possibly be in core. 5 /// Generic utility functions. Stuff that should possibly be in core.
6 library pub.utils; 6 library pub.utils;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import "dart:convert"; 9 import "dart:convert";
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 } 812 }
813 813
814 /// Throw a [ApplicationException] with [message]. 814 /// Throw a [ApplicationException] with [message].
815 void fail(String message, [innerError, StackTrace innerTrace]) { 815 void fail(String message, [innerError, StackTrace innerTrace]) {
816 if (innerError != null) { 816 if (innerError != null) {
817 throw new WrappedException(message, innerError, innerTrace); 817 throw new WrappedException(message, innerError, innerTrace);
818 } else { 818 } else {
819 throw new ApplicationException(message); 819 throw new ApplicationException(message);
820 } 820 }
821 } 821 }
822
823 /// Throw a [DataException] with [message] to indicate that the command has
824 /// failed because of invalid input data.
825 ///
826 /// This will report the error and cause pub to exit with [exit_codes.DATA].
827 void dataError(String message) {
828 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
829 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698