在以下功能中:
cmd.exe
我收到以下日志消息:
function processDeviceOffline(deviceID) {
var sqlstr = sql.format("SELECT Location, Name FROM devices WHERE DeviceID = ?", [deviceID]);
var query = db.query(sqlstr, function(err, result){
try {
if (err) {
console.log("processDeviceOffline SQL error: %j", err);
console.log('When '+deviceID+' reported Offline');
} else {
if (result[0]) {
utils.notify('Device Offline: '+result[0].Name+'-'+result[0].Location+')');
} else {
utils.notify(`Unknown Device Offline: ${deviceID}`);
}
}
} catch(ex) {
console.log("processDeviceOffline %j (%j)", ex, result);
}
});
}
为什么异常对象'ex'为空?