sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Add `options.ignoreErrors` accepting String and Regex

Open krystofwoldrich opened this issue 1 year ago • 1 comments

Description

Javascript and some other Sentry SDKs already have this option. The reason to add it to sentry-java are Hybrid SDKs. At the moment users of hybrids have to manually initialize the native SDKs to filter out native errors in beforeSend. Having ignoreErrors in sentry-java enables hybrid SDKs to pass the hybrid ignoreErrors enabling user filter both hybrid and native errors.

https://docs.sentry.io/platforms/react-native/configuration/options/#ignore-errors

Implementation

The option should be accepting Strings and Regexes.

  1. As a public option for native and hybrid users.
  2. As an option for Hybrid SDKs only (hidden in InternalSentrySDK)

Related issues

  • https://github.com/getsentry/sentry-cocoa/issues/4046

krystofwoldrich avatar Jun 10 '24 09:06 krystofwoldrich

@krystofwoldrich fyi we already have addIgnoredExceptionForType but that only accepts classes.

adinauer avatar Jun 10 '24 12:06 adinauer

Similar to https://github.com/getsentry/sentry-java/issues/2660

adinauer avatar Jan 14 '25 14:01 adinauer

@krystofwoldrich do you need ignoreErrors to be on the manifest options as well?

adinauer avatar Jan 20 '25 15:01 adinauer

Only in code is perfect.

krystofwoldrich avatar Jan 26 '25 23:01 krystofwoldrich