Fix error when shared process exits with null
This commit is contained in:
parent
4af84fcaf6
commit
e12fcd3a0d
packages/server/src/vscode
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue