MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / parseStackFrames

Function parseStackFrames

packages/browser/src/eventbuilder.ts:110–129  ·  view source on GitHub ↗

Parses stack frames from an error

(
  stackParser: StackParser,
  ex: Error & { framesToPop?: number; stacktrace?: string },
)

Source from the content-addressed store, hash-verified

108
109/** Parses stack frames from an error */
110function parseStackFrames(
111 stackParser: StackParser,
112 ex: Error & { framesToPop?: number; stacktrace?: string },
113): StackFrame[] {
114 // Access and store the stacktrace property before doing ANYTHING
115 // else to it because Opera is not very good at providing it
116 // reliably in other circumstances.
117 const stacktrace = ex.stacktrace || ex.stack || '';
118
119 const skipLines = getSkipFirstStackStringLines(ex);
120 const framesToPop = getPopFirstTopFrames(ex);
121
122 try {
123 return stackParser(stacktrace, skipLines, framesToPop);
124 } catch {
125 // no-empty
126 }
127
128 return [];
129}
130
131// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
132const reactMinifiedRegexp = /Minified React error #\d+;/i;

Callers 4

exceptionFromErrorFunction · 0.70
eventFromPlainObjectFunction · 0.70
eventFromUnknownInputFunction · 0.70
eventFromStringFunction · 0.70

Calls 2

getPopFirstTopFramesFunction · 0.85

Tested by

no test coverage detected