[flutter_tool] Don't crash on Android emulator startup failure#48995
Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom Jan 17, 2020
zanderso:fix-emulator-startup-fail
Merged
[flutter_tool] Don't crash on Android emulator startup failure#48995fluttergithubbot merged 1 commit intoflutter:masterfrom zanderso:fix-emulator-startup-fail
fluttergithubbot merged 1 commit intoflutter:masterfrom
zanderso:fix-emulator-startup-fail
Conversation
blasten
reviewed
Jan 17, 2020
There was a problem hiding this comment.
would it make sense to print message in this case as well?
Member
Author
There was a problem hiding this comment.
Yeah, I shuffled the prints around a bit, so that it'll be a bit more clear.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before my refactoring of
ProcessUtils, when the Android emulator process failed, we would throw and catch the error as a string and print it. After my refactoring ofProcessUtilsthe error was thrown as aProcessExceptionbut the code to catch the exception wasn't updated. This resulted in the Android emulator process failures crashing the tool instead of beingToolExits as was intended.Only the Android emulator code was using the String based throw/catch. This PR removes that, and refactors the emulator process management code to print errors instead of relying on exceptions.
Related Issues
Current top crasher on stable from crash logging.
Tests
I added the following tests:
Added tests to android_emulator_test.dart.
Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].