How to use the raven.on function in raven

To help you get started, we’ve selected a few raven examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nylas-mail-lives / nylas-mail / packages / client-app / src / error-logger-extensions / nylas-private-error-reporter.js View on Github external
_setupSentry() {
    // Initialize the Sentry connector
    if (!sentryDSN) {
      return;
    }
    Raven.disableConsoleAlerts();
    Raven.config(sentryDSN, {
      name: this.deviceHash,
      release: this.getVersion(),
    }).install();

    Raven.on('error', (e) => {
      console.log(e.reason);
      console.log(e.statusCode);
      return console.log(e.response);
    });
  }
github nylas-mail-lives / nylas-mail / packages / client-private-plugins / src / error-logger-extensions / nylas-private-error-reporter.js View on Github external
_setupSentry() {
    // Initialize the Sentry connector
    const sentryDSN = "https://a556c0165bc74435952c95dccc5938ec:484978beb99f40208cb86610e66bead6@sentry.io/144447"

    Raven.disableConsoleAlerts();
    Raven.config(sentryDSN, {
      name: this.deviceHash,
      release: this.getVersion(),
    }).install();

    Raven.on('error', (e) => {
      console.log(e.reason);
      console.log(e.statusCode);
      return console.log(e.response);
    });
  }
github guzru / winston-sentry / sentry-transport.js View on Github external
extra: {}
  }

  // For backward compatibility with deprecated `globalTags` option
  options.tags = options.tags || options.globalTags;

  this.options = _.defaultsDeep(options, this.defaults);

  Raven.config(this.options.dsn, this.options);

  if (this.options.patchGlobal) {
    Raven.install();
  }

  // Handle errors
  Raven.on('error', function(error) {
    var message = "Cannot talk to sentry.";
    if (error && error.reason) {
        message += " Reason: " + error.reason;
    }
    console.log(message);
  });
};
github nylas-mail-lives / nylas-mail / packages / local-private / src / error-logger-extensions / nylas-private-error-reporter.js View on Github external
_setupSentry() {
    // Initialize the Sentry connector
    const sentryDSN = "https://0796ad36648a40a094128d6e0287eda4:0c329e562cc74e06a48488772dd0f578@sentry.io/134984"

    Raven.disableConsoleAlerts();
    Raven.config(sentryDSN, {
      name: this.deviceHash,
      release: this.getVersion(),
    }).install();

    Raven.on('error', (e) => {
      console.log(e.reason);
      console.log(e.statusCode);
      return console.log(e.response);
    });
  }
github Foundry376 / Mailspring / app / src / error-logger-extensions / raven-error-reporter.js View on Github external
{
        name: this.deviceHash,
        release: this.getVersion(),
      }
    ).install();

    // Just give us something random that we can use to tell how many users are impacted
    // by each bug. This is important because sometimes one user will hit an exception 1,000
    // times and skew the Sentry data.
    Raven.mergeContext({
      user: {
        id: this.deviceHash,
      },
    });

    Raven.on('error', e => {
      console.log(`Raven: ${e.statusCode} - ${e.reason}`);
    });
  }
};
github irccloud / irccloud-desktop / app / crash_reporter.js View on Github external
function setupRaven() {
  if (pkg.irccloud.sentry_dsn) {
    const _Raven = require('raven');
    _Raven.on('error', (e) => {
      log.error('Raven error', e);
    });
    raven_config().then((config) => {
      _Raven.config(pkg.irccloud.sentry_dsn, config);
      Raven = _Raven;
    });
    ipcMain.on('set-user', (event, sessionUser) => {
      user = sessionUser;
    });
  }
}