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

Unified Diff: lib/src/io.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/formatter_exception.dart ('k') | test/formatter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index 51f380585dc8486f17ff2474e3723d905dd12937..eeaa53244bd57f62adcd33a67342a00fd7cac9ab 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -9,7 +9,7 @@ import 'dart:io';
import 'package:path/path.dart' as p;
import 'dart_formatter.dart';
-import 'formatter_exception.dart';
+import 'exceptions.dart';
import 'formatter_options.dart';
import 'source_code.dart';
@@ -81,9 +81,13 @@ bool processFile(FormatterOptions options, File file, {String label}) {
stdioType(stderr) == StdioType.TERMINAL;
stderr.writeln(err.message(color: color));
+ } on UnexpectedOutputException catch (err) {
+ stderr.writeln('''Hit a bug in the formatter when formatting $label.
+$err
+Please report at github.com/dart-lang/dart_style/issues.''');
} catch (err, stack) {
stderr.writeln('''Hit a bug in the formatter when formatting $label.
-Please report at: github.com/dart-lang/dart_style/issues
+Please report at github.com/dart-lang/dart_style/issues.
$err
$stack''');
}
« no previous file with comments | « lib/src/formatter_exception.dart ('k') | test/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698