Skip to content

Commit 64dc42f

Browse files
committed
feat(core): Add Googletag error to InboundFilters default ignore list
test biome :(
1 parent 0b8540f commit 64dc42f

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

packages/core/src/integrations/inboundfilters.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const DEFAULT_IGNORE_ERRORS = [
1010
/^Script error\.?$/,
1111
/^Javascript error: Script error\.? on line 0$/,
1212
/^ResizeObserver loop completed with undelivered notifications.$/,
13+
/^Cannot redefine property: googletag$/,
1314
];
1415

1516
/** Options for the InboundFilters integration */

packages/core/test/lib/integrations/inboundfilters.test.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ const RESIZEOBSERVER_EVENT: Event = {
198198
},
199199
};
200200

201+
const GOOGLETAG_EVENT: Event = {
202+
exception: {
203+
values: [
204+
{
205+
type: 'TypeError',
206+
value: 'Cannot redefine property: googletag',
207+
},
208+
],
209+
},
210+
};
211+
201212
const MALFORMED_EVENT: Event = {
202213
exception: {
203214
values: [
@@ -299,16 +310,21 @@ describe('InboundFilters', () => {
299310
expect(eventProcessor(EXCEPTION_EVENT, {})).toBe(null);
300311
});
301312

302-
it('uses default filters', () => {
313+
it('uses default filters (script error)', () => {
303314
const eventProcessor = createInboundFiltersEventProcessor();
304315
expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null);
305316
});
306317

307-
it('uses default filters ResizeObserver', () => {
318+
it('uses default filters (ResizeObserver)', () => {
308319
const eventProcessor = createInboundFiltersEventProcessor();
309320
expect(eventProcessor(RESIZEOBSERVER_EVENT, {})).toBe(null);
310321
});
311322

323+
it('uses default filters (googletag)', () => {
324+
const eventProcessor = createInboundFiltersEventProcessor();
325+
expect(eventProcessor(GOOGLETAG_EVENT, {})).toBe(null);
326+
});
327+
312328
it('filters on last exception when multiple present', () => {
313329
const eventProcessor = createInboundFiltersEventProcessor({
314330
ignoreErrors: ['incorrect type given for parameter `chewToy`'],

0 commit comments

Comments
 (0)