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

Unified Diff: sdk/lib/_internal/pub/bin/pub.dart

Issue 354053002: Report all transformer load errors before exiting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/bin/pub.dart
diff --git a/sdk/lib/_internal/pub/bin/pub.dart b/sdk/lib/_internal/pub/bin/pub.dart
index 0664ff56fd6faa62cbdab3f853b9e978632f063e..ab95fc6ecf0ccf45d3a42eb5ff68f67d6f32f997 100644
--- a/sdk/lib/_internal/pub/bin/pub.dart
+++ b/sdk/lib/_internal/pub/bin/pub.dart
@@ -8,7 +8,6 @@ import 'dart:io';
import 'package:args/args.dart';
import 'package:http/http.dart' as http;
import 'package:path/path.dart' as path;
-import 'package:source_maps/source_maps.dart';
import 'package:stack_trace/stack_trace.dart';
import '../lib/src/command.dart';
@@ -88,35 +87,7 @@ void runPub(String cacheDir, ArgResults options, List<String> arguments) {
captureErrors(() => invokeCommand(cacheDir, options),
captureStackChains: captureStackChains).catchError((error, Chain chain) {
- // This is basically the top-level exception handler so that we don't
- // spew a stack trace on our users.
- if (error is SpanException) {
- log.error(error.toString(useColors: canUseSpecialChars));
- } else {
- log.error(getErrorMessage(error));
- }
- log.fine("Exception type: ${error.runtimeType}");
-
- if (log.json.enabled) {
- if (error is UsageException) {
- // Don't print usage info in JSON output.
- log.json.error(error.message);
- } else {
- log.json.error(error);
- }
- }
-
- if (options['trace'] || !isUserFacingException(error)) {
- log.error(chain.terse);
- } else {
- log.fine(chain.terse);
- }
-
- if (error is WrappedException && error.innerError != null) {
- var message = "Wrapped exception: ${error.innerError}";
- if (error.innerChain != null) message = "$message\n${error.innerChain}";
- log.fine(message);
- }
+ log.exception(error, chain);
if (options['trace']) {
log.dumpTranscript();
@@ -141,6 +112,8 @@ and include the results in a bug report on http://dartbug.com/new.
/// Returns the appropriate exit code for [exception], falling back on 1 if no
/// appropriate exit code could be found.
int chooseExitCode(exception) {
+ while (exception is WrappedException) exception = exception.innerError;
+
if (exception is HttpException || exception is http.ClientException ||
exception is SocketException || exception is PubHttpException) {
return exit_codes.UNAVAILABLE;
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698