Skip to content

Commit 5aca7ca

Browse files
authored
fix(core): Filter out unactionable Facebook Mobile browser error (#15430)
Filters out an unactionable error thrown by the Facebook Mobile browser web view. Closes #15065
1 parent 6363e75 commit 5aca7ca

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/core/src/integrations/inboundfilters.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const DEFAULT_IGNORE_ERRORS = [
1919
"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users
2020
"Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/
2121
/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps
22+
/^Java exception was raised during method invocation$/, // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065)
2223
];
2324

2425
/** Options for the InboundFilters integration */

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

+16
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,17 @@ const CEFSHARP_EVENT: Event = {
281281
},
282282
};
283283

284+
const FB_MOBILE_BROWSER_EVENT: Event = {
285+
exception: {
286+
values: [
287+
{
288+
type: 'Error',
289+
value: 'Java exception was raised during method invocation',
290+
},
291+
],
292+
},
293+
};
294+
284295
const MALFORMED_EVENT: Event = {
285296
exception: {
286297
values: [
@@ -402,6 +413,11 @@ describe('InboundFilters', () => {
402413
expect(eventProcessor(CEFSHARP_EVENT, {})).toBe(null);
403414
});
404415

416+
it('uses default filters (FB Mobile Browser)', () => {
417+
const eventProcessor = createInboundFiltersEventProcessor();
418+
expect(eventProcessor(FB_MOBILE_BROWSER_EVENT, {})).toBe(null);
419+
});
420+
405421
it('filters on last exception when multiple present', () => {
406422
const eventProcessor = createInboundFiltersEventProcessor({
407423
ignoreErrors: ['incorrect type given for parameter `chewToy`'],

0 commit comments

Comments
 (0)