diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-14 17:41:05 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-14 17:41:05 -0700 |
commit | a407c36f89ae7738f6993239b88cd9a2362c1fd7 (patch) | |
tree | 75ea6ef9b3de6c3337dc39191e06ac465f693fbc | |
parent | 3729bfb0fb98770ea30ab51069fbe32db8939808 (diff) | |
download | sncontinue-a407c36f89ae7738f6993239b88cd9a2362c1fd7.tar.gz sncontinue-a407c36f89ae7738f6993239b88cd9a2362c1fd7.tar.bz2 sncontinue-a407c36f89ae7738f6993239b88cd9a2362c1fd7.zip |
log error on retry
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 8 |
1 files 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); } }; |