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

Unified Diff: lib/src/dart_formatter.dart

Issue 2837143003: Don't dump a stack trace on the user if the formatter had bad output. (Closed)
Patch Set: Created 3 years, 8 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 | « lib/dart_style.dart ('k') | lib/src/error_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/dart_formatter.dart
diff --git a/lib/src/dart_formatter.dart b/lib/src/dart_formatter.dart
index 24d94831dd9622d935c1263a023c9296120ff475..2e75e62fe69eb1b82c58a3eb7aabf8a7a052d08d 100644
--- a/lib/src/dart_formatter.dart
+++ b/lib/src/dart_formatter.dart
@@ -15,7 +15,7 @@ import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/string_source.dart';
import 'error_listener.dart';
-import 'formatter_exception.dart';
+import 'exceptions.dart';
import 'source_code.dart';
import 'source_visitor.dart';
import 'string_compare.dart' as string_compare;
@@ -131,8 +131,7 @@ class DartFormatter {
var visitor = new SourceVisitor(this, lineInfo, source);
var output = visitor.run(node);
if (!string_compare.equalIgnoringWhitespace(source.text, output.text)) {
- throw new FormatException('Cannot safely format file as formatting '
- 'would cause non-whitespace change(s).');
+ throw new UnexpectedOutputException(source.text, output.text);
}
return output;
« no previous file with comments | « lib/dart_style.dart ('k') | lib/src/error_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698