-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flutter_tool] Don't crash on Android emulator startup failure #48995
[flutter_tool] Don't crash on Android emulator startup failure #48995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
unawaited(stdoutSubscription.cancel()); | ||
unawaited(stderrSubscription.cancel()); | ||
if (!earlyFailure && stderrList.isEmpty) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to print message in this case as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I shuffled the prints around a bit, so that it'll be a bit more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks!
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 ofProcessUtils
the error was thrown as aProcessException
but the code to catch the exception wasn't updated. This resulted in the Android emulator process failures crashing the tool instead of beingToolExit
s 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].