Skip to content

Commit

Permalink
don't crash languageServer on invalid binary (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Ronde committed Dec 23, 2023
1 parent cb8890d commit ad633a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ async function main(): Promise<void> {
proc.stderr.on('data', (chunk) => {
data += chunk;
});
proc.on('error', (err) => {
void log(
connection,
SERVER_PREFIX,
`Failed to get PHPStan version, is the path to your PHPStan binary correct? Error: ${err.message}`
);
});
proc.on('close', (code) => {
console.log(code, data);
if (code === 0) {
void log(
connection,
Expand Down

0 comments on commit ad633a1

Please sign in to comment.