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"""; |
+ } |
+} |