How to use the raven-js.isSetup function in raven-js

To help you get started, we’ve selected a few raven-js 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 flow-typed / flow-typed / definitions / npm / raven-js_v3.17.x / test_raven-js.js View on Github external
it("works", () => {
      const isSetup: boolean = Raven.isSetup();

      // $ExpectError - Raven.isSetup returns a boolean
      const isSetupString: string = Raven.isSetup();
    });
  });
github ngokevin / redux-raven-middleware / index.es6 View on Github external
export default function createMiddleware(dsn, cfg={}, options={}) {
  /*
    Function that generates a crash reporter for Sentry.

    dsn - private Sentry DSN.
    cfg - object to configure Raven.
    options - customize extra data sent to sentry
      actionTransformer - tranform the action object to send; default to identity function
      stateTransformer - transform the state object to send; default to identity function
      logger - the logger to use for logging; default to console.error
  */
  if (!Raven.isSetup()) {
    if (!dsn) {
      // Skip this middleware if there is no DSN.
      console.error('[redux-raven-middleware] Sentry DSN required.');
      return store => next => action => {
        return next(action);
      };
    }
    Raven.config(dsn, cfg).install();
  }

  return store => next => action => {
    const {
      actionTransformer = identity,
      stateTransformer = identity,
      logger = console.error.bind(console, '[redux-raven-middleware] Reporting error to Sentry:')
    } = options;
github cyverse / troposphere / troposphere / static / js / utilities / clipboardFunctions.js View on Github external
function reportException(ex) {
    // take Mulder's advice - trustno1
    if (Raven && Raven.isSetup()) {
        if (Raven.captureException) {
            Raven.captureException(ex);
        }
    }
}
github cyverse / troposphere / troposphere / static / js / components / Master.jsx View on Github external
// subscribe to all Stores
        Object.keys(stores).forEach(
            function(storeName) {
                stores[storeName].addChangeListener(this.updateState);
            }.bind(this)
        );

        if (globals.BADGES_ENABLED) {
            this.loadBadgeData();
        }

        // The code below is only relevant to logged in users
        if (!context.hasLoggedInUser()) return;

        if (Raven && window.SENTRY_DSN) {
            if (!Raven.isSetup()) {
                Raven.config(window.SENTRY_DSN).install();
            }
            this.loadRavenData();
        }

        // IMPORTANT! We get one shot at this. If the instances and volumes aren't
        // fetched before this component is mounted we miss our opportunity to migrate
        // the users resources (so make sure they're fetched in the Splash Screen)
        var instances = stores.InstanceStore.getInstancesNotInAProject(),
            volumes = stores.VolumeStore.getVolumesNotInAProject(),
            nullProject = new NullProject({
                instances: instances,
                volumes: volumes
            });
        let all_instances = stores.InstanceStore.getAll();
github octalmage / gatsby-plugin-sentry / gatsby-browser.js View on Github external
require.ensure(['raven-js'], function(require) {
      const Raven = require('raven-js');

      if (!Raven.isSetup()) Raven.config(pluginParams.dsn, pluginParams.config).install();
      window.Raven = Raven;
    });
  }
github mirego / ember-boilerplate / app / services / raven.js View on Github external
isRavenUsable: computed(() => {
    return !!(Raven && Raven.isSetup() === true);
  }).volatile(),
github geli-lms / geli / app / webFrontend / src / app / shared / services / raven-error-handler.service.ts View on Github external
setup(dsn: string) {
    if (!Raven.isSetup() && dsn) {
      Raven
        .config(dsn, {
          environment: 'web-frontend',
          release: '$TRAVIS_COMMIT',
        })
        .install();
    }
  }