Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move the regex
  • Loading branch information
timfish committed Feb 11, 2022
commit 3c1e7c28eb67656d18555aa6e1e4826f998b2805
6 changes: 3 additions & 3 deletions packages/browser/src/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ export function eventFromError(ex: Error): Event {
};
}

// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
const reactMinifiedRegexp = /Minified React error #\d+;/i;

/** Parses stack frames from an error */
export function parseStackFrames(ex: Error & { framesToPop?: number; stacktrace?: string }): StackFrame[] {
// Access and store the stacktrace property before doing ANYTHING
Expand All @@ -101,6 +98,9 @@ export function parseStackFrames(ex: Error & { framesToPop?: number; stacktrace?
return [];
}

// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
const reactMinifiedRegexp = /Minified React error #\d+;/i;

function getPopSize(ex: Error & { framesToPop?: number }): number {
if (ex) {
if (typeof ex.framesToPop === 'number') {
Expand Down