4
在我的應用程序的頂部,我有這樣的代碼:Node.js - 比process.on更好的錯誤處理('uncaughtException',fn)?
process.on('uncaughtException', function(err) {
console.log("We found an uncaught exception.");
console.log(err);
});
如果我搜索我的日誌grep -i -A10 -B3 'uncaught exception' logfile
,我可以得到一些不錯的信息。但我不知道異常拋出的執行上下文是什麼,錯誤是什麼等等。
應該使用什麼樣的模式?
謝謝約翰。 – 2012-04-04 17:22:51