async-exit-hook icon indicating copy to clipboard operation
async-exit-hook copied to clipboard

Error thrown in `exitHook` is not handled causing zombie process

Open sjones6 opened this issue 6 years ago • 0 comments

The runHook method has no error handling:

if (err) {
  // Pass error, calling uncaught exception handlers
  return hook(err, stepTowardExit);
}
return hook(stepTowardExit);

If a hook throws, then the exit procedure stops and exit is never actually achieved. (I found this by hitting #9 which threw in an exit routine.)

This could be fixed by wrapping in a try/catch and calling stepTowardsExit on error.

sjones6 avatar Apr 05 '19 15:04 sjones6