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

Side by Side Diff: utils/pub/pub.dart

Issue 10917053: Show nicer errors on some server failures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unnecessary check. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/pub_install_hosted_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * The main entrypoint for the pub command line application. 6 * The main entrypoint for the pub command line application.
7 */ 7 */
8 #library('pub'); 8 #library('pub');
9 9
10 #import('../../pkg/args/args.dart'); 10 #import('../../pkg/args/args.dart');
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 try { 177 try {
178 commandOptions = commandParser.parse(commandArgs); 178 commandOptions = commandParser.parse(commandArgs);
179 } on FormatException catch (e) { 179 } on FormatException catch (e) {
180 this.printUsage(description: e.message); 180 this.printUsage(description: e.message);
181 return; 181 return;
182 } 182 }
183 183
184 handleError(error, trace) { 184 handleError(error, trace) {
185 // This is basically the top-level exception handler so that we don't 185 // This is basically the top-level exception handler so that we don't
186 // spew a stack trace on our users. 186 // spew a stack trace on our users.
187 // TODO(rnystrom): Add --trace flag so stack traces can be enabled for
188 // debugging.
189 var message = error.toString(); 187 var message = error.toString();
190 188
191 // TODO(rnystrom): The default exception implementation class puts 189 // TODO(rnystrom): The default exception implementation class puts
192 // "Exception:" in the output, so strip that off. 190 // "Exception:" in the output, so strip that off.
193 if (message.startsWith("Exception: ")) { 191 if (message.startsWith("Exception: ")) {
194 message = message.substring("Exception: ".length); 192 message = message.substring("Exception: ".length);
195 } 193 }
196 194
197 printError(message); 195 printError(message);
198 if (globalOptions['trace'] && trace != null) { 196 if (globalOptions['trace'] && trace != null) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 print(''); 232 print('');
235 print('Usage: $usage'); 233 print('Usage: $usage');
236 234
237 var commandUsage = commandParser.getUsage(); 235 var commandUsage = commandParser.getUsage();
238 if (!commandUsage.isEmpty()) { 236 if (!commandUsage.isEmpty()) {
239 print(''); 237 print('');
240 print(commandUsage); 238 print(commandUsage);
241 } 239 }
242 } 240 }
243 } 241 }
OLDNEW
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/pub_install_hosted_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698