所以,我一直在安静地看着这个。从 Node.js 0.8.15 开始,Event: 'uncaughtException'
http : //nodejs.org/api/process.html#process_event_uncaughtexception说:
Don't use it, use domains instead. If you do use it, restart your application after every unhandled exception!
http://nodejs.org/api/domain.html上的域说:
Stability: 1 - Experimental
(他们也拒绝为我工作——我的应用程序仍然崩溃)
我要做的就是不让我的 Node.js + Express 应用程序崩溃。
任何人成功地将所有错误记录到文件(预期和意外的语法错误)并且不让 Node.js 崩溃的任何实际方式?
我听过很多理论上的答案,任何有效的实际代码?