当我在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行。似乎堆栈跟踪以某种方式无法访问,并且在错误对象中不可用。
有谁知道为什么会这样?
这是另一个例子: