From a407c36f89ae7738f6993239b88cd9a2362c1fd7 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 14 Aug 2023 17:41:05 -0700 Subject: log error on retry --- extension/src/activation/environmentSetup.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 01115281..c87f1a7b 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -233,10 +233,10 @@ export async function startContinuePythonServer(redownload: boolean = true) { let delay = 1000; // Delay between each attempt in milliseconds const spawnChild = () => { - const retry = () => { + const retry = (e: any) => { attempts++; console.log( - `Error caught (likely EBUSY). Retrying attempt ${attempts}...` + `Error caught: ${e}.\n\nRetrying attempt ${attempts}...` ); setTimeout(spawnChild, delay); }; @@ -266,7 +266,7 @@ export async function startContinuePythonServer(redownload: boolean = true) { }); child.on("error", (err: any) => { if (attempts < maxAttempts) { - retry(); + retry(err); } else { console.error("Failed to start subprocess.", err); } @@ -282,7 +282,7 @@ export async function startContinuePythonServer(redownload: boolean = true) { } } catch (e: any) { console.log("Error starting server:", e); - retry(); + retry(e); } }; -- cgit v1.2.3-70-g09d2