记录节点错误时,为什么堆栈跟踪丢失?

时间:2015-10-05 15:28:19

标签: javascript node.js

当我在node.js v4中记录错误时,它们经常缺少stacktrace,它被Cannot read property 'name' of undefined取代。例如:

   Error: SyntaxError: Unexpected identifier
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>
    at <error: TypeError: Cannot read property 'name' of undefined>

注意stacktrace行。似乎堆栈跟踪以某种方式无法访问,并且在错误对象中不可用。

有谁知道为什么会这样?

这是另一个例子:

0 个答案:

没有答案