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
This commit is contained in:
Lorenzo Blasa
2023-06-02 09:35:32 -07:00
committed by Facebook GitHub Bot
parent 80c201b10f
commit 353e51e2ea
3 changed files with 62 additions and 31 deletions

View File

@@ -47,7 +47,11 @@ export function createFlipperServerWithSocket(
let initialConnectionTimeout: ReturnType<typeof setTimeout> | 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);