From c4aecc829c1fd5e8ec922eca4cbf7a57201bafe3 Mon Sep 17 00:00:00 2001 From: Unitech Date: Fri, 18 Sep 2015 17:50:50 +0200 Subject: [PATCH] wrap process.kill into try catch --- lib/God/Methods.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/God/Methods.js b/lib/God/Methods.js index 6c4245b1..e831cdde 100644 --- a/lib/God/Methods.js +++ b/lib/God/Methods.js @@ -213,7 +213,9 @@ module.exports = function(God) { } else { console.log('Process with pid %d still alive after %sms, sending it SIGKILL now...', pid, cst.KILL_TIMEOUT); - process.kill(-(parseInt(pid)), 'SIGKILL'); + try { + process.kill(-(parseInt(pid)), 'SIGKILL'); + } catch(e) { console.error('Process cannot be killed', e.message || e.stack || e); } return God.processIsDead(pid, cb, true); } }, cst.KILL_TIMEOUT);