More than 10 lines in a node.js stack error?

后端 未结 4 1908
花落未央
花落未央 2020-12-07 11:11

Is there a way to get more than 10 lines in a node.js stack error?

function a() { dieInHell(); }
function b() { a(); }
function c() { b(); }
function d() { c         


        
4条回答
  •  忘掉有多难
    2020-12-07 11:47

    Easiest solution for that is to start your code with following:

    Error.stackTraceLimit = Infinity;
    

    If you'd like to see stack trace that spans over setTimeout/setInterval calls, then more sophisticated https://github.com/mattinsler/longjohn would be the way to go.

提交回复
热议问题