Catch error where process killing didn't scceed

master
Kuba Orlik 4 years ago
parent 09e9551cdf
commit a3d1a2bc27

@ -49,7 +49,15 @@ export class DeferedSpawn extends Emittery {
kill() {
console.log("killing process!", this.process.spawnargs.join(" "));
process.kill(-this.process.pid); // https://stackoverflow.com/a/49842576
try {
process.kill(-this.process.pid); // https://stackoverflow.com/a/49842576
} catch (e) {
console.log(
"Didn't kill process",
this.process.spawnfile,
", maybe it was killed already"
);
}
}
write(data: string) {

Loading…
Cancel
Save