Catch and log errors thrown by process.kill()

These can occur if killing the process fails because it no longer exists.
This commit is contained in:
Kevin Sawicki
2013-06-06 16:22:05 -07:00
parent dc46960e6c
commit 9fea9ea756

View File

@@ -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: ->