Added more logging when there's an error getting device details.

This commit is contained in:
Mike Riccio
2015-10-16 09:36:18 -07:00
parent aad811fe6e
commit c22c14584d

View File

@@ -80,14 +80,16 @@ IndigoPlatform.prototype = {
request(deviceOptions, function(deviceError, deviceResponse, deviceBody) {
if (deviceError) {
asyncCallback(deviceError);
console.trace("Requesting Indigo device info: " + deviceURL + "\nError: " + deviceError + "\nResponse: " + deviceBody);
asyncCallback(deviceError)
}
else {
var deviceJson = JSON.parse(deviceBody);
that.log("Discovered " + deviceJson.type + ": " + deviceJson.name);
that.foundAccessories.push(
new IndigoAccessory(that.log, that.auth, deviceURL, deviceJson));
asyncCallback();
}
var deviceJson = JSON.parse(deviceBody);
that.log("Discovered " + deviceJson.type + ": " + deviceJson.name);
that.foundAccessories.push(
new IndigoAccessory(that.log, that.auth, deviceURL, deviceJson));
asyncCallback();
});
}, function(asyncError) {
// This will be called after all the requests complete