Skip to content

Commit 19fb467

Browse files
committed
fix(other): CHECKOUT-6524 Relax the error filtering rule to report errors if some of the frames in the stack trace are thrown from the app code
1 parent 0401418 commit 19fb467

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/core/src/app/common/error/SentryErrorLogger.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('SentryErrorLogger', () => {
107107
expect(clientOptions.beforeSend!(event, hint)).toBeNull();
108108
});
109109

110-
it('logs exception event if all frames in stacktrace reference app file', () => {
110+
it('logs exception event if some frames in stacktrace reference app file', () => {
111111
new SentryErrorLogger(config, options);
112112

113113
const clientOptions: BrowserOptions = createClient.mock.calls[0][0];
@@ -117,8 +117,9 @@ describe('SentryErrorLogger', () => {
117117
{
118118
stacktrace: {
119119
frames: [
120-
{ filename: 'app:///js/app-123.js' },
121-
{ filename: 'app:///js/app-456.js' },
120+
{ filename: 'app:///js/app-123.js', in_app: true },
121+
{ filename: '<anonymous>', in_app: true },
122+
{ filename: 'app:///js/app-456.js', in_app: true },
122123
],
123124
},
124125
type: 'Error',

packages/core/src/app/common/error/SentryErrorLogger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ export default class SentryErrorLogger implements ErrorLogger {
157157
return false;
158158
}
159159

160-
return exception.stacktrace.frames.every((frame) =>
161-
frame.filename?.startsWith(FILENAME_PREFIX),
160+
return exception.stacktrace.frames.some((frame) =>
161+
frame.filename?.startsWith(FILENAME_PREFIX) && frame.in_app,
162162
);
163163
});
164164
}

0 commit comments

Comments
 (0)