From e12fcd3a0d926ce70a153daf739d5273dbe7c0ca Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 3 Apr 2019 17:32:20 -0500 Subject: [PATCH] Fix error when shared process exits with null --- packages/server/src/vscode/sharedProcess.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/vscode/sharedProcess.ts b/packages/server/src/vscode/sharedProcess.ts index 4f83ba27e..5383bf0c5 100644 --- a/packages/server/src/vscode/sharedProcess.ts +++ b/packages/server/src/vscode/sharedProcess.ts @@ -115,8 +115,10 @@ export class SharedProcess { this.activeProcess = activeProcess; await new Promise((resolve, reject): void => { - const doReject = (error: Error | number): void => { - if (typeof error === "number") { + const doReject = (error: Error | number | null): void => { + if (error === null) { + error = new Error("Exited unexpectedly"); + } else if (typeof error === "number") { error = new Error(`Exited with ${error}`); } activeProcess.removeAllListeners();