From 9fea9ea75683443489b347130dc8bdf760d63e34 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 6 Jun 2013 16:22:05 -0700 Subject: [PATCH] Catch and log errors thrown by process.kill() These can occur if killing the process fails because it no longer exists. --- src/atom-application.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/atom-application.coffee b/src/atom-application.coffee index 8fabee8c4..2618e0521 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -249,7 +249,11 @@ class AtomApplication openedWindow.browserWindow.on 'closed', => for pid, trackedWindow of @pidsToOpenWindows when trackedWindow is openedWindow - process.kill(pid) + try + process.kill(pid) + catch error + if error.code isnt 'ESRCH' + console.log("Killing process #{pid} failed: #{error.code}") delete @pidsToOpenWindows[pid] openConfig: ->