Fix error when shared process exits with null

This commit is contained in:
Asher 2019-04-03 17:32:20 -05:00
parent 4af84fcaf6
commit e12fcd3a0d
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
1 changed files with 4 additions and 2 deletions
packages/server/src/vscode

View File

@ -115,8 +115,10 @@ export class SharedProcess {
this.activeProcess = activeProcess; this.activeProcess = activeProcess;
await new Promise((resolve, reject): void => { await new Promise((resolve, reject): void => {
const doReject = (error: Error | number): void => { const doReject = (error: Error | number | null): void => {
if (typeof error === "number") { if (error === null) {
error = new Error("Exited unexpectedly");
} else if (typeof error === "number") {
error = new Error(`Exited with ${error}`); error = new Error(`Exited with ${error}`);
} }
activeProcess.removeAllListeners(); activeProcess.removeAllListeners();