Exit flutter_tester with an error code on an unhandled exception (flutter/engine#9932)

This commit is contained in:
Jason Simmons
2019-07-22 12:06:34 -07:00
committed by GitHub
parent b48ddc3d9c
commit 8be5805dff

View File

@@ -266,6 +266,15 @@ int main(int argc, char* argv[]) {
fml::MessageLoop::GetCurrent().RemoveTaskObserver(key);
};
settings.unhandled_exception_callback = [](const std::string& error,
const std::string& stack_trace) {
FML_LOG(ERROR) << "Unhandled exception" << std::endl
<< "Exception: " << error << std::endl
<< "Stack trace: " << stack_trace;
::exit(1);
return true;
};
return flutter::RunTester(
settings, command_line.HasOption(
flutter::FlagForSwitch(flutter::Switch::RunForever)));