Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log PATH environnement variable if starting server fails. #1637

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-extensionHost",
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
Expand All @@ -17,7 +17,6 @@
"request": "attach",
"name": "Attach to Server",
"address": "localhost",
"protocol": "inspector",
"port": 6011,
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/server/out/**/*.js"]
Expand Down
8 changes: 7 additions & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand Down