From 36ccf22e02bb285f14df7b91a6bf07629bb8959f Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sat, 9 Dec 2017 14:49:11 +0100 Subject: [PATCH] More informative error when master is unavailable --- client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index e88f0562..5d508f35 100644 --- a/client.js +++ b/client.js @@ -730,7 +730,9 @@ function instanceManagement() { // get inventory from Master and RCON it to our slave setInterval(function () { needle.get(config.masterIP + ":" + config.masterPort + '/api/inventory', function (err, response, body) { - if (response && response.body) { + if(err){ + console.log("Unable to get JSON master/api/inventory, master might be unaccessible"); + } else if (response && response.body) { // Take the inventory we (hopefully) got and turn it into the format LUA accepts try { var inventory = JSON.parse(response.body);