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

Function hideInternalStackFrames

lib/internal/errors.js:961–974  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

959
960// Hide stack lines before the first user code line.
961function hideInternalStackFrames(error) {
962 overrideStackTrace.set(error, (error, stackFrames) => {
963 let frames = stackFrames;
964 if (typeof stackFrames === 'object') {
965 frames = ArrayPrototypeFilter(
966 stackFrames,
967 (frm) => !StringPrototypeStartsWith(frm.getFileName() || '',
968 'node:internal'),
969 );
970 }
971 ArrayPrototypeUnshift(frames, error);
972 return ArrayPrototypeJoin(frames, '\n at ');
973 });
974}
975
976// Node uses an AbortError that isn't exactly the same as the DOMException
977// to make usage of the error in userland and readable-stream easier.

Callers 1

errors.jsFile · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…