minor updates

This commit is contained in:
Martin Donnelly 2016-03-23 15:46:48 +00:00
parent 8f1de5e809
commit 9326877e98
3 changed files with 27 additions and 4 deletions

View File

@ -37,7 +37,12 @@ module.exports = {
}
});
});
}, function(error, response, body) {
if(response.statusCode !== 200) {
logger.error(response.statusCode);
logger.error(body);
}
});
}
};

View File

@ -154,6 +154,11 @@ module.exports = {
});
todayCache.data.history = todayCache.data.history.concat(output);
console.log(todayCache.data.history);
}, function(error, response, body) {
if(response.statusCode !== 200) {
logger.error(response.statusCode);
logger.error(body);
}
});
},
getHistory: function () {
@ -188,7 +193,12 @@ module.exports = {
console.log(todayCache.data.history);
module.exports.getTechHistory();
});
}, function(error, response, body) {
if(response.statusCode !== 200) {
logger.error(response.statusCode);
logger.error(body);
}
});
},
getTrainUpdates: function (id) {
console.log('Getting train events...');
@ -244,7 +254,12 @@ module.exports = {
}
todayCache.data.trains.data = _.uniq(todayCache.data.trains.data);
});
}, function(error, response, body) {
if(response.statusCode !== 200) {
logger.error(response.statusCode);
logger.error(body);
}
});
todayCache.data.trains.last = now;

View File

@ -174,6 +174,9 @@ function Query(callback, r, host, path) {
response.on('end', function () {
callback(JSON.parse(data), r);
});
response.on('error', function(e) {
console.error(e);
});
}).end();
} catch (e) {
console.log(e);