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

Unified Diff: lib/src/exceptions.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/src/error_listener.dart ('k') | lib/src/formatter_exception.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/exceptions.dart
diff --git a/lib/src/formatter_exception.dart b/lib/src/exceptions.dart
similarity index 81%
rename from lib/src/formatter_exception.dart
rename to lib/src/exceptions.dart
index 6696aa4f35794ed50dfbf8cc5effd7fd9b9918dc..41756af06421fd43d7d7d66712626379dbbff14a 100644
--- a/lib/src/formatter_exception.dart
+++ b/lib/src/exceptions.dart
@@ -51,3 +51,22 @@ class FormatterException implements Exception {
String toString() => message();
}
+
+/// Exception thrown when the internal sanity check that only whitespace
+/// changes are made fails.
+class UnexpectedOutputException implements Exception {
+ /// The source being formatted.
+ final String _input;
+
+ /// The resulting output.
+ final String _output;
+
+ UnexpectedOutputException(this._input, this._output);
+
+ String toString() {
+ return """The formatter produced unexpected output. Input was:
+$_input
+Which formatted to:
+$_output""";
+ }
+}
« no previous file with comments | « lib/src/error_listener.dart ('k') | lib/src/formatter_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698