From fc9eb3051fd5a7c9cad57b5d6cd93374bd8210fb Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 27 Jul 2023 19:16:17 -0700 Subject: fix: :bug: catch error when workspace uri isn't defined --- extension/src/activation/activate.ts | 12 ++++++++---- extension/src/activation/environmentSetup.ts | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'extension/src/activation') diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 40f1bbd5..8bdc7e21 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -22,10 +22,14 @@ function getExtensionVersionInt(versionString: string): number { export async function activateExtension(context: vscode.ExtensionContext) { extensionContext = context; console.log("Using Continue version: ", getExtensionVersion()); - console.log( - "In workspace: ", - vscode.workspace.workspaceFolders?.[0].uri.fsPath - ); + try { + console.log( + "In workspace: ", + vscode.workspace.workspaceFolders?.[0].uri.fsPath + ); + } catch (e) { + console.log("Error getting workspace folder: ", e); + } // Before anything else, check whether this is an out-of-date version of the extension // Do so by grabbing the package.json off of the GitHub respository for now. fetch(PACKAGE_JSON_RAW_GITHUB_URL) diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index c8998bee..44fb3b60 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -430,6 +430,7 @@ export async function startContinuePythonServer() { setupServerPath(); return await retryThenFail(async () => { + console.log("Checking if server is old version"); // Kill the server if it is running an old version if (fs.existsSync(serverVersionPath())) { const serverVersion = fs.readFileSync(serverVersionPath(), "utf8"); -- cgit v1.2.3-70-g09d2