Skip to content

Commit

Permalink
Fix error when shared process exits with null
Browse files Browse the repository at this point in the history
  • Loading branch information
code-asher committed Apr 3, 2019
1 parent 4af84fc commit e12fcd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/server/src/vscode/sharedProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e12fcd3

Please sign in to comment.