From bf7d6ed08c7e5fd272e756815f55833cb7a9bd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Sat, 1 Apr 2017 12:46:39 +0200 Subject: [PATCH] Catch errors while spawning processes and log to console --- lib/server.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/server.js b/lib/server.js index 5201e82..535c175 100644 --- a/lib/server.js +++ b/lib/server.js @@ -158,6 +158,10 @@ Server.prototype.start = function() { self.emit('state'); }); + instance.on('error', function (err) { + console.log(err); + }); + this.pid = instance.pid; this.instance = instance; this.queryStatusInterval = setInterval(function () { @@ -190,6 +194,10 @@ Server.prototype.start = function() { self.headlessInstance = null; }); + headlessInstance.on('error', function (err) { + console.log(err); + }); + self.headlessInstance = headlessInstance; }