Skip to content

Commit

Permalink
Suppress EPERM when killing child processes
Browse files Browse the repository at this point in the history
This is the signal OS X throws when trying to kill a process group where
the pid has already stopped
  • Loading branch information
airhorns committed Jul 20, 2023
1 parent abf9ecf commit 85acd14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wds",
"version": "0.17.2",
"version": "0.17.3",
"author": "Harry Brundage",
"license": "MIT",
"bin": {
Expand Down
5 changes: 2 additions & 3 deletions src/Supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export class Supervisor extends EventEmitter {
try {
process.kill(-pid, signal);
} catch (error: any) {
if (error.code == "ESRCH") {
// process can't be found, is already dead
return;
if (error.code == "ESRCH" || error.code == "EPERM") {
// process can't be found or can't be killed again, its already dead
} else {
throw error;
}
Expand Down

0 comments on commit 85acd14

Please sign in to comment.