Skip to content

Commit 6f660b5

Browse files
authored
Log PATH environnement variable if starting server fails. (#1637)
1 parent 9786bc4 commit 6f660b5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.vscode/launch.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.2.0",
44
"configurations": [
55
{
6-
"type": "pwa-extensionHost",
6+
"type": "extensionHost",
77
"request": "launch",
88
"name": "Launch Client",
99
"runtimeExecutable": "${execPath}",
@@ -17,7 +17,6 @@
1717
"request": "attach",
1818
"name": "Attach to Server",
1919
"address": "localhost",
20-
"protocol": "inspector",
2120
"port": 6011,
2221
"sourceMaps": true,
2322
"outFiles": ["${workspaceFolder}/server/out/**/*.js"]

client/src/extension.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ function realActivate(context: ExtensionContext): void {
142142
})
143143
);
144144

145-
client.start().catch((error) => client.error(`Starting the server failed.`, error, 'force'));
145+
client.start().catch((error) => {
146+
client.error(`Starting the server failed.`, error, 'force');
147+
const message = typeof error === 'string' ? error : typeof error.message === 'string' ? error.message : undefined;
148+
if (message !== undefined && message.indexOf('ENOENT') !== -1) {
149+
client.info(`PATH environment variable is: ${process.env['PATH']}`);
150+
}
151+
});
146152
}
147153

148154
export function deactivate(): Promise<void> {

0 commit comments

Comments
 (0)