diff --git a/lib/iotaUtils.js b/lib/iotaUtils.js index c570624b..e3ccc430 100644 --- a/lib/iotaUtils.js +++ b/lib/iotaUtils.js @@ -76,7 +76,7 @@ function findOrCreate(deviceId, transport, apikey, group, callback) { .info(context, 'Update provisioned device %j with measure/group apikey %j', device, group.apikey); device.apikey = group.apikey; // group apikey is the same of current measure apikey iotAgentLib.updateDevice(device, function (error) { - callback(null, device, group); + callback(error, device, group); }); } else { callback(null, device, group);