diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-27 19:16:17 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-27 19:16:17 -0700 |
commit | fc9eb3051fd5a7c9cad57b5d6cd93374bd8210fb (patch) | |
tree | 55e7936f142ba9dbff3424ed8cbd911eab86162a /extension/src/activation | |
parent | 5346aa7f5cc26385bff37bb22954a3d70535e2db (diff) | |
download | sncontinue-fc9eb3051fd5a7c9cad57b5d6cd93374bd8210fb.tar.gz sncontinue-fc9eb3051fd5a7c9cad57b5d6cd93374bd8210fb.tar.bz2 sncontinue-fc9eb3051fd5a7c9cad57b5d6cd93374bd8210fb.zip |
fix: :bug: catch error when workspace uri isn't defined
Diffstat (limited to 'extension/src/activation')
-rw-r--r-- | extension/src/activation/activate.ts | 12 | ||||
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 1 |
2 files changed, 9 insertions, 4 deletions
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"); |