Skip to content

Commit

Permalink
Fixes #1313: Capture the exit code of a server process and print it t…
Browse files Browse the repository at this point in the history
…o the log. (#1315)
  • Loading branch information
dbaeumer committed Sep 13, 2023
1 parent c880c61 commit c6817d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions client/src/node/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,17 @@ export class LanguageClient extends BaseLanguageClient {
}
}
return Promise.reject<MessageTransports>(new Error(`Unsupported server configuration ` + JSON.stringify(server, null, 4)));
}).finally(() => {
if (this._serverProcess !== undefined) {
this._serverProcess.on('exit', (code, signal) => {
if (code !== null) {
this.error(`Server process exited with code ${code}.`, undefined, false);
}
if (signal !== null) {
this.error(`Server process exited with signal ${signal}.`, undefined, false);
}
});
}
});
}

Expand Down

0 comments on commit c6817d3

Please sign in to comment.