From 267304f34ea19044aff008b105dc4c8bdeec99fb Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Mon, 17 Apr 2023 09:48:31 +0200 Subject: [PATCH] Log PATH environnement variable if starting server fails. --- .vscode/launch.json | 3 +-- client/src/extension.ts | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index a4861983..e921ad8d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,7 +3,7 @@ "version": "0.2.0", "configurations": [ { - "type": "pwa-extensionHost", + "type": "extensionHost", "request": "launch", "name": "Launch Client", "runtimeExecutable": "${execPath}", @@ -17,7 +17,6 @@ "request": "attach", "name": "Attach to Server", "address": "localhost", - "protocol": "inspector", "port": 6011, "sourceMaps": true, "outFiles": ["${workspaceFolder}/server/out/**/*.js"] diff --git a/client/src/extension.ts b/client/src/extension.ts index 97944350..d1aa5fe1 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -142,7 +142,13 @@ function realActivate(context: ExtensionContext): void { }) ); - client.start().catch((error) => client.error(`Starting the server failed.`, error, 'force')); + client.start().catch((error) => { + client.error(`Starting the server failed.`, error, 'force'); + const message = typeof error === 'string' ? error : typeof error.message === 'string' ? error.message : undefined; + if (message !== undefined && message.indexOf('ENOENT') !== -1) { + client.info(`PATH environment variable is: ${process.env['PATH']}`); + } + }); } export function deactivate(): Promise {