[Node.js] Show More Lines in a Node.js Error Stack Trace

时间:2023-03-09 19:33:51
[Node.js] Show More Lines in a Node.js Error Stack Trace

Sometimes you are one or two lines short from finding the cause of the error in the stack trace but you can't because Nodejs displays only a handful of lines. In this lesson, you will learn how to increase the stack trace limit to show more lines

Error.stackTraceLimit = ;

main();
function main() {
one();
}
function one() {
two();
}
function two() {
three();
}
function three() {
four();
}
function four() {
five();
}
function five() {
six();
}
function six() {
seven();
}
function seven() {
eight();
}
function eight() {
nine();
}
function nine() {
ten();
}
function ten() {
eleven();
}
function eleven() {
twelve();
}
function twelve() {
throw new Error("I can't see the whole stack strace");
}