mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
More informative error when master is unavailable
This commit is contained in:
1 parent
7682a51437
commit
36ccf22e02
1 file changed
+3
-1
@@ -730,7 +730,9 @@ function instanceManagement() {
|
|||||||
// get inventory from Master and RCON it to our slave
|
// get inventory from Master and RCON it to our slave
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
needle.get(config.masterIP + ":" + config.masterPort + '/api/inventory', function (err, response, body) {
|
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
|
// Take the inventory we (hopefully) got and turn it into the format LUA accepts
|
||||||
try {
|
try {
|
||||||
var inventory = JSON.parse(response.body);
|
var inventory = JSON.parse(response.body);
|
||||||
|
|||||||
Reference in new issue
Block a user