0
我正在使用邊緣模塊(https://github.com/tjanczuk/edge)從sql數據庫中讀取。功能如下:Node.js服務器正在打破沒有任何錯誤
function getBetweenRows(cb) {
//console.log("lastcheckedID inside function ", lastCheckedID);
//console.log("lastinsertID inside function ", lastInsertID);
console.log("here 2");
var query = {
connectionString: "Data Source=localhost;Initial Catalog=db-name;Integrated Security=True",
//source: "SELECT * FROM CustomerMaster WHERE CustomerID BETWEEN '" + lastCheckedID + "' AND '" + lastInsertID + "';"
source: "SELECT * FROM CustomerMaster WHERE CustomerID BETWEEN '2965' AND '2972';"
};
console.log("query is ", query.source);
console.log("here 3");
var getRows = edge.func('sql', query);
console.log("here 4");
getRows(null, function(error, result) {
console.log("here 5");
if (error) {
console.log(error);
throw error;
log.error({rows:error});
}
rows = result;
log.info({rows:rows});
console.log(rows);
console.log("here 6");
cb(rows);
});
}
有趣的是這段代碼在其他一些系統上完美地工作。但在這個特定的系統上,它會打印到here 4
,然後服務器中斷。它不顯示任何錯誤。我如何找出問題所在?
嘗試'try {} catch' – laggingreflex 2014-10-07 05:48:27