OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library analyzer.src.error; | 4 library analyzer.src.error; |
5 | 5 |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 | 7 |
8 import 'package:analyzer/src/generated/error.dart'; | 8 import 'package:analyzer/error/error.dart'; |
9 | 9 |
10 /// The maximum line length when printing extracted source code when converting | 10 /// The maximum line length when printing extracted source code when converting |
11 /// an [AnalyzerError] to a string. | 11 /// an [AnalyzerError] to a string. |
12 final _MAX_ERROR_LINE_LENGTH = 120; | 12 final _MAX_ERROR_LINE_LENGTH = 120; |
13 | 13 |
14 /// A wrapper around [AnalysisError] that provides a more user-friendly string | 14 /// A wrapper around [AnalysisError] that provides a more user-friendly string |
15 /// representation. | 15 /// representation. |
16 class AnalyzerError implements Exception { | 16 class AnalyzerError implements Exception { |
17 final AnalysisError error; | 17 final AnalysisError error; |
18 | 18 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 : this(errors.map((e) => new AnalyzerError(e))); | 88 : this(errors.map((e) => new AnalyzerError(e))); |
89 | 89 |
90 /// The errors in this collection. | 90 /// The errors in this collection. |
91 List<AnalyzerError> get errors => | 91 List<AnalyzerError> get errors => |
92 new UnmodifiableListView<AnalyzerError>(_errors); | 92 new UnmodifiableListView<AnalyzerError>(_errors); |
93 | 93 |
94 String get message => toString(); | 94 String get message => toString(); |
95 @override | 95 @override |
96 String toString() => errors.join("\n"); | 96 String toString() => errors.join("\n"); |
97 } | 97 } |
OLD | NEW |