From 8eb97635691519022fdff338099a878ae5df6004 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 10 Dec 2015 11:25:19 -0800 Subject: [PATCH] Improve error messages when build fails Instead of failing with a cryptic error message about app.flx, we now fail with an explicit message about the compiler. Releated to #865 --- packages/flutter_tools/lib/src/commands/build.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart index 5f8b0a969d8..5a06b0dc8a8 100644 --- a/packages/flutter_tools/lib/src/commands/build.dart +++ b/packages/flutter_tools/lib/src/commands/build.dart @@ -164,7 +164,8 @@ class BuildCommand extends FlutterCommand { outputPath: localBundlePath, mainPath: mainPath ); - onBundleAvailable(localBundlePath); + if (result == 0) + onBundleAvailable(localBundlePath); } finally { tempDir.deleteSync(recursive: true); } @@ -195,8 +196,10 @@ class BuildCommand extends FlutterCommand { // In a precompiled snapshot, the instruction buffer contains script // content equivalents int result = await toolchain.compiler.compile(mainPath: mainPath, snapshotPath: snapshotPath); - if (result != 0) + if (result != 0) { + logging.severe('Failed to run the Flutter compiler. Exit code: $result'); return result; + } archive.addFile(_createSnapshotFile(snapshotPath)); }