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

Unified Diff: packages/analyzer/lib/src/error.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 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 | « packages/analyzer/lib/src/dart/sdk/sdk.dart ('k') | packages/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/analyzer/lib/src/error.dart
diff --git a/packages/analyzer/lib/src/error.dart b/packages/analyzer/lib/src/error.dart
index 60f5cf094676498d083db7fa60fdf0452ab4801f..5039da55577d0ce33033c300b4d318b67ed40c27 100644
--- a/packages/analyzer/lib/src/error.dart
+++ b/packages/analyzer/lib/src/error.dart
@@ -1,11 +1,11 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library error;
+library analyzer.src.error;
import 'dart:collection';
-import 'generated/error.dart';
+import 'package:analyzer/error/error.dart';
/// The maximum line length when printing extracted source code when converting
/// an [AnalyzerError] to a string.
@@ -20,12 +20,15 @@ class AnalyzerError implements Exception {
String get message => toString();
+ @override
String toString() {
var builder = new StringBuffer();
// Print a less friendly string representation to ensure that
// error.source.contents is not executed, as .contents it isn't async
- builder.write("Error in ${error.source.shortName}: ${error.message}");
+ String sourceName = error.source.shortName;
+ sourceName ??= '<unknown source>';
+ builder.write("Error in $sourceName: ${error.message}");
// var content = error.source.contents.data;
// var beforeError = content.substring(0, error.offset);
@@ -89,5 +92,6 @@ class AnalyzerErrorGroup implements Exception {
new UnmodifiableListView<AnalyzerError>(_errors);
String get message => toString();
+ @override
String toString() => errors.join("\n");
}
« no previous file with comments | « packages/analyzer/lib/src/dart/sdk/sdk.dart ('k') | packages/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698