我开发一个明确的应用程序。使用process.on('uncaughtException显示500错误页面
目前,我有我的server.js以下
process.on('uncaughtException', function (err) {
console.log("UNCAUGHT EXCEPTION ");
console.log("[Inside 'uncaughtException' event] " + err.stack || err.message);
});
哪个停止服务器崩溃每有一个错误,但是,它只是坐在那里的时间...
是可以代替的console.log的,与错误的详细信息发送500错误页面?
不工作。未定义'app.error'。自从这个答案发布后(> 2年前),ExpressJS API可能会发生变化。 ExpressJS异常处理涵盖在:http://expressjs.com/guide.html#error-handling – 2014-07-04 15:21:49
app.error不是函数。 – 2016-04-11 06:53:44