admin管理员组文章数量:1279120
I've found that when I have runtime errors (for example, reading an undefined property from an object) in a GET handler in express.js, Express is great at giving me feedback in the browser as to what the problem is and with a full stack trace.
However, when I have runtime errors as a result of an Ajax POST call, I don't get the same level of feedback and the Node console is sadly silent on the matter.
Is this an Express configuration issue?
I've found that when I have runtime errors (for example, reading an undefined property from an object) in a GET handler in express.js, Express is great at giving me feedback in the browser as to what the problem is and with a full stack trace.
However, when I have runtime errors as a result of an Ajax POST call, I don't get the same level of feedback and the Node console is sadly silent on the matter.
Is this an Express configuration issue?
Share Improve this question asked Nov 4, 2011 at 20:27 GregGreg 2,6095 gold badges31 silver badges46 bronze badges1 Answer
Reset to default 12Found the answer to my own questions...
You need to configure express's error handler to dump exceptions.
app.use(express.errorHandler({showStack: true, dumpExceptions: true}));
本文标签: javascriptHow can I get expressjs to catch and report runtime exceptions in AJAX callsStack Overflow
版权声明:本文标题:javascript - How can I get express.js to catch and report runtime exceptions in AJAX calls - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741254959a2366492.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论