Skip to content

setShouldSendCallback() is suppressing errors when returns false #368

@almirfilho

Description

@almirfilho

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

v8.9.4
5.6.0
ukulele@1.14.0 /Users/almirfilho/Realgeeks/ukulele
├── @realgeeks/react-native-gallery@0.1.2
├── @realgeeks/react-native-multi-slider@0.3.8
├── cheerio-without-node-native@0.20.2
├── color@2.0.0
├── cookie@0.3.1
├── fast-memoize@2.2.8
├── geojson-polygon-self-intersections@1.1.2
├── lodash@4.17.4
├── moment@2.19.1
├── moment-range@3.0.3
├── numbro@1.11.0
├── paginator@1.0.0
├── polygon-offset@0.3.1
├── prop-types@15.6.0
├── qs@6.5.1
├── react@16.0.0
├── react-native@0.50.4
├── react-native-animatable@1.2.4
├── react-native-background-fetch@2.2.1
├── react-native-blur@3.2.0
├── react-native-branch@2.1.1
├── react-native-code-push@5.1.3-beta
├── react-native-cookies@3.2.0
├── react-native-device-info@0.12.1
├── react-native-htmlview@0.12.1
├── react-native-linear-gradient@2.3.0
├── react-native-maps@0.17.1
├── react-native-onesignal@3.0.6
├── react-native-radio-buttons@1.0.0
├── react-native-sentry@0.34.0
├── react-native-spinkit@1.1.1
├── react-native-swipeout@2.3.1
├── react-native-swiper@1.5.13
├── react-native-vector-icons@4.4.2
├── react-navigation@1.0.0-beta.22
├── react-redux@5.0.6
├── redux@3.7.2
├── redux-devtools-extension@2.13.2
├── redux-thunk@2.2.0
├── seamless-immutable@7.1.2
├── supercluster@2.3.0
├── uuid@3.1.0
└── validator@9.1.1

Config:

Sentry.config('https://...@sentry.io/...', {
  logLevel: SentryLog.Verbose
}).install()

I have following issue:

Errors are being suppressed when setShouldSendCallback() method is set with a callback that returns false. This is useful to send events only when not in development mode, but I want to see the errors when in development mode.

Steps to reproduce:
Set the shouldSendCallback with a callback that return false.

const env = 'development'; // from somewhere else

Sentry.setShouldSendCallback(() => {
  return env === 'production';
});

Actual result:

  • Does not send event. (working as expected)
  • Does suppress error (does not throw the error again).

Expected result:

  • Does not send event. (working as expected)
  • Should throw the error (should not suppress error).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions