[flutter_tools] rethrow process exceptions as tool exit from gradle build (#64745)

The flutter tool is currently unable to detect missing permissions in gradle/gradle.bat that would cause a gradle build to fail via process exception. Rather than crashing and exiting, we can display the exception as an error message and tool exit.

While linux/macOS are able to add the +x bit, this is not possible on windows with our current file system/OS API. These crashes represent a substantial amount of crash reporting, but are otherwise not actionable on our end.
This commit is contained in:
Jonah Williams
2020-09-03 11:55:55 -07:00
committed by GitHub
parent 20936eeac4
commit bd3eee75f3
11 changed files with 270 additions and 28 deletions

View File

@@ -397,7 +397,7 @@ Future<void> buildGradleApp({
environment: gradleEnvironment,
mapFunction: consumeLog,
);
} on ProcessException catch(exception) {
} on ProcessException catch (exception) {
consumeLog(exception.toString());
// Rethrow the exception if the error isn't handled by any of the
// `localGradleErrors`.