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

Unified Diff: pkg/string_scanner/lib/src/exception.dart

Issue 343043002: Make StringScannerException extend SpanFormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « pkg/string_scanner/CHANGELOG.md ('k') | pkg/string_scanner/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/string_scanner/lib/src/exception.dart
diff --git a/pkg/string_scanner/lib/src/exception.dart b/pkg/string_scanner/lib/src/exception.dart
index c3986871a8cff41e0f5219616c6700faa7ac8964..44ec9a3e715720b4e3d646e41330049eec8241f4 100644
--- a/pkg/string_scanner/lib/src/exception.dart
+++ b/pkg/string_scanner/lib/src/exception.dart
@@ -7,10 +7,7 @@ library string_scanner.exception;
import 'package:source_maps/source_maps.dart';
/// An exception thrown by a [StringScanner] that failed to parse a string.
-class StringScannerException implements FormatException {
- /// The error message.
- final String message;
-
+class StringScannerException extends SpanFormatException {
/// The source string being parsed.
final String string;
@@ -19,19 +16,6 @@ class StringScannerException implements FormatException {
/// This may be `null`, indicating that the source URL is unknown.
final Uri sourceUrl;
- /// The span within [string] that caused the exception.
- final Span span;
-
- StringScannerException(this.message, this.string, this.sourceUrl, this.span);
-
- /// Returns a detailed description of this exception.
- ///
- /// If [useColors] is true, the section of the source that caused the
- /// exception will be colored using ANSI color codes. By default, it's colored
- /// red, but a different ANSI code may passed via [color].
- String toString({bool useColors: false, String color}) {
- return "Error on " + span.getLocationMessage(
- message, useColors: useColors, color: color);
- }
+ StringScannerException(String message, this.string, this.sourceUrl, Span span)
+ : super(message, span);
}
-
« no previous file with comments | « pkg/string_scanner/CHANGELOG.md ('k') | pkg/string_scanner/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698