From 353e51e2ea0e0bfe9f005a61dc50aa50c021b2c7 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Fri, 2 Jun 2023 09:35:32 -0700 Subject: [PATCH] Better error message format Summary: The existing error message was not in the centre and didn't give any possible remediation steps. {F1015240268} Reviewed By: passy Differential Revision: D46394149 fbshipit-source-id: 09d450bef9df83c5b3af3ba49c7e0fafb81bfdce --- desktop/app/src/init.tsx | 4 +- .../src/FlipperServerClient.tsx | 6 +- desktop/static/index.html | 83 ++++++++++++------- 3 files changed, 62 insertions(+), 31 deletions(-) diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 96c71e6a2..7dba9d674 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -231,8 +231,8 @@ async function start() { start().catch((e) => { console.error('Failed to start Flipper desktop', e); - document.getElementById('root')!.textContent = - 'Failed to start Flipper desktop: ' + e; + document.getElementById('loading')!.textContent = + 'Failed to start Flipper. ' + e; }); function getStaticPath(appPath: string) { diff --git a/desktop/flipper-server-client/src/FlipperServerClient.tsx b/desktop/flipper-server-client/src/FlipperServerClient.tsx index 9d94a5213..489fa7f70 100644 --- a/desktop/flipper-server-client/src/FlipperServerClient.tsx +++ b/desktop/flipper-server-client/src/FlipperServerClient.tsx @@ -47,7 +47,11 @@ export function createFlipperServerWithSocket( let initialConnectionTimeout: ReturnType | undefined = setTimeout(() => { reject( - new Error('Failed to connect to flipper-server in a timely manner'), + new Error( + `Failed to connect to the server in a timely manner. + It may be unresponsive. Run the following from the terminal + 'lsof -nP -iTCP -sTCP:LISTEN | grep 52342' and kill the listed process, if any.`, + ), ); }, CONNECTION_TIMEOUT); diff --git a/desktop/static/index.html b/desktop/static/index.html index b752be3c7..51b12c14d 100644 --- a/desktop/static/index.html +++ b/desktop/static/index.html @@ -1,32 +1,59 @@ - - - - - - - - Flipper - - -
- - + - - + } catch (e) { + console.error("Failed to initialize theme", e); + document.getElementById('flipper-theme-import').href = "themes/light.css"; + } + + + +