diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index e36ba8252ab4735ef0a2e972f5cac8e2970011bd..2acfae056f35449d2f2c46b163865b3172572af1 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -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)));