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

View File

@ -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();