MCPcopy Index your code
hub / github.com/nodejs/node / getStackString

Function getStackString

lib/internal/util/inspect.js:1743–1762  ·  view source on GitHub ↗
(ctx, error)

Source from the content-addressed store, hash-verified

1741}
1742
1743function getStackString(ctx, error) {
1744 let stack;
1745 try {
1746 stack = error.stack;
1747 } catch {
1748 // If stack is getter that throws, we ignore the error.
1749 }
1750 if (stack) {
1751 if (typeof stack === 'string') {
1752 return stack;
1753 }
1754 ctx.seen.push(error);
1755 ctx.indentationLvl += 4;
1756 const result = formatValue(ctx, stack);
1757 ctx.indentationLvl -= 4;
1758 ctx.seen.pop();
1759 return `${ErrorPrototypeToString(error)}\n ${result}`;
1760 }
1761 return ErrorPrototypeToString(error);
1762}
1763
1764function getStackFrames(ctx, err, stack) {
1765 const frames = StringPrototypeSplit(stack, '\n');

Callers 2

getStackFramesFunction · 0.85
formatErrorFunction · 0.85

Calls 3

formatValueFunction · 0.85
popMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…