Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shouldSendCallback() not working #2253

Closed
4 of 9 tasks
jaimefps opened this issue Sep 26, 2019 · 5 comments
Closed
4 of 9 tasks

shouldSendCallback() not working #2253

jaimefps opened this issue Sep 26, 2019 · 5 comments

Comments

@jaimefps
Copy link

jaimefps commented Sep 26, 2019

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

^5.6.2

Description

I'm trying to leverage shouldSendCallback and dataCallback, but nothing get's logged when I forcefully throw errors. However, beforeSend does log the event when the forced errors occur.

So I am confused why beforeSend method works with console.log(), but the other two do not.

I've been using Sentry for a few months and everything has worked fine, it is only now with the two methods mentioned above that I cannot seem to get them to log anything for me to confirm they are working.

My config:


{
  dsn: '<my_dsn>',
  release: process.env.RELEASE,
  environment: process.env.NODE_ENV

  // not working
  shouldSendCallback(data) {
    console.log('data1:', data);
    return true;
  },

  // not working
  dataCallback(data) {
    console.log('data2:', data);
    return data;
  },

  // working fine
  beforeSend(event) {
    console.log('event:', event)
    return event;
  },

@kamilogorek
Copy link
Contributor

kamilogorek commented Sep 27, 2019

There's no such thing as shouldSendCallback or dataCallback in @sentry/browser. It's the old API of raven-js package.

@jaimefps
Copy link
Author

@kamilogorek I see, is beforeSend() the correct way of ignoring an alert?
I noticed that returning null makes it so that no alert is found in Sentry dashboard.

@kamilogorek
Copy link
Contributor

@Phil-Barber
Copy link

@kamilogorek
Copy link
Contributor

Thanks, updated https://github.com/getsentry/static-sites/pull/406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants