Skip to content

Commit c6817d3

Browse files
authored
Fixes #1313: Capture the exit code of a server process and print it to the log. (#1315)
1 parent c880c61 commit c6817d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

client/src/node/main.ts

+11
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,17 @@ export class LanguageClient extends BaseLanguageClient {
502502
}
503503
}
504504
return Promise.reject<MessageTransports>(new Error(`Unsupported server configuration ` + JSON.stringify(server, null, 4)));
505+
}).finally(() => {
506+
if (this._serverProcess !== undefined) {
507+
this._serverProcess.on('exit', (code, signal) => {
508+
if (code !== null) {
509+
this.error(`Server process exited with code ${code}.`, undefined, false);
510+
}
511+
if (signal !== null) {
512+
this.error(`Server process exited with signal ${signal}.`, undefined, false);
513+
}
514+
});
515+
}
505516
});
506517
}
507518

0 commit comments

Comments
 (0)