question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shouldSendCallback() not working

See original GitHub issue

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;
  },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Configuration | Sentry Documentation
{ shouldSendCallback: function(data) { return false; } }. maxMessageLength: By default, Raven does not truncate messages. If you need to truncate characters ...
Read more >
Configuration — raven-js 3.4.0 documentation - Read the Docs
js in an environment like React Native or Electron, where your application is running “natively” on a device and not accessed at a...
Read more >
Sentry/Raven with Meteor on Server - help
Meteor.startup(function () { let sentryURL = 'https://' + ... See: https://github.com/meteorhacks/kadira/issues/193 var message = m; ...
Read more >
Raven Testkit | Sentry-Testkit
Raven Testkit (Legacy API). Raven is a JavaScript SDK published by Sentry.io to enable software flow tracking and issues reporting to the Sentry...
Read more >
raven-js | Yarn - Package Manager
... crashing React Native plugin unless shouldSendCallback is specified. ... Fixed an issue with the require.js plugin basically not working at all.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found