Skip to content

Filtering duplicated Unhandled JS Errors doesn't work with obfuscated class names on Android #3126

@krystofwoldrich

Description

@krystofwoldrich

Description

Our current solution to avoid duplicated errors being reported to Sentry doesn't work with obfuscated class names as we are checking the exception type against the string JavascriptException.

We have to check this as React Native passes unhandled exceptions from JS layer to the native layers. We catch and send the exception in the JS layer with JS context, the native exception doesn't provide any more useful information.

// React native internally throws a JavascriptException
// Since we catch it before that, we don't want to send this one
// because we would send it twice
try {
SentryException ex = event.getExceptions().get(0);
if (null != ex && ex.getType().contains("JavascriptException")) {
return null;
}
} catch (Throwable ignored) {
// We do nothing
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions