Make sure Flipper server startup errors are propagated for desktop
Summary: If openssl is not available, this would lead to an unhandled rejection exception. That is because a lot initialization logic generates promises that don't get a catch chained on immediately. Changed the flipper server startup flow to be more idiomatically async Fixes https://github.com/facebook/flipper/issues/2766 Changelog: More clearly communicate if flipper server failed to start (e.d. due to port already taken, openssl not being available) This change fixes it only for desktop flipper, will make sure the browser UI will support this as well (the error will fire correctly there, but there are no listeners during startup) Reviewed By: nikoant Differential Revision: D33348923 fbshipit-source-id: f561bb27b18a3041c514b37f7aed11435a49647f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7f944ae946
commit
8259f92983
@@ -96,7 +96,6 @@ async function start() {
|
||||
keytar,
|
||||
);
|
||||
|
||||
await flipperServer.connect();
|
||||
const flipperServerConfig = await flipperServer.exec('get-config');
|
||||
|
||||
initializeElectron(flipperServer, flipperServerConfig);
|
||||
@@ -110,6 +109,8 @@ async function start() {
|
||||
// eslint-disable-next-line import/no-commonjs
|
||||
require('flipper-ui-core').startFlipperDesktop(flipperServer);
|
||||
|
||||
await flipperServer.connect();
|
||||
|
||||
// Initialize launcher
|
||||
setupPrefetcher(flipperServerConfig.settings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user