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

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

Issue 351703004: Improve pub's pubspec error messages. (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/transformer_config.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 94d5ab08a1b271b047c214b4f5c81ab287f6d50b..35830f8c6fbef4abe8678baf31ec9d3ca9b4606d 100644
--- a/sdk/lib/_internal/pub/bin/pub.dart
+++ b/sdk/lib/_internal/pub/bin/pub.dart
@@ -8,6 +8,7 @@ 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';
@@ -86,8 +87,11 @@ void runPub(String cacheDir, ArgResults options, List<String> arguments) {
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.
- var message = getErrorMessage(error);
- log.error(message);
+ 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) {
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698