How to use the raven-js.captureException 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 ngokevin / redux-raven-middleware / index.es6 View on Github external
actionTransformer = identity,
      stateTransformer = identity,
      logger = console.error.bind(console, '[redux-raven-middleware] Reporting error to Sentry:')
    } = options;
    try {
      Raven.captureBreadcrumb({
        category: 'redux',
        message: action.type
      });

      return next(action);
    } catch (err) {
      logger(err);

      // Send the report.
      Raven.captureException(err, {
        extra: {
          action: actionTransformer(action),
          state: stateTransformer(store.getState()),
        }
      });
    }
  }
}
github commercetools / merchant-center-application-kit / src / middleware / sentry-tracking.js View on Github external
action.type === ADD_NOTIFICATION &&
    action.payload.kind === 'unexpected-error'
  ) {
    const {
      meta: { error },
    } = action;

    // Check that the `error` is set
    if (!error && process.env.NODE_ENV !== 'production')
      // eslint-disable-next-line no-console
      console.error('Missing error object when dispatching unexpected error.');

    if (process.env.NODE_ENV !== 'production') return next(action);

    // Send the error to Sentry
    Raven.captureException(error);
    // Generate a unique ID referring to the last generated Sentry error
    const errorId = Raven.lastEventId();

    // The error stack should be available in Sentry, so there is no
    // need to print it in the console as well.
    // We just notify that an error occured and provide the error ID.
    // eslint-disable-next-line no-console
    console.error(`An error occured (ID: ${errorId}).`);

    // Inject the generated errorId into the notification values,
    // in order to display it in the notification message.
    return next({
      ...action,
      payload: {
        ...action.payload,
        values: {
github Venryx / DebateMap / Source / Frame / General / Errors.ts View on Github external
if (!message.startsWith("Assert failed) ")) {
		errorStr += `An error has occurred: `;
	}
	if (!stack.Contains(message)) {
		errorStr += message;
	}
	errorStr += (errorStr.length ? "\n" : "") + stack;
	LogError(errorStr);

	if (recordWithSentry) {
		/*(()=> {
			// errors that should be shown to user, but not recorded
			if (message.startsWith("KaTeX parse error: ")) return;
			Raven.captureException(error);
		})();*/
		Raven.captureException(error, {extra: extraInfo});
	}

	// wait a bit, in case we're in a reducer function (calling dispatch from within a reducer errors)
	setTimeout(()=> {
		store.dispatch(new ACTNotificationMessageAdd(new NotificationMessage(errorStr)));
	});
}
github cyverse / troposphere / troposphere / static / js / components / common / ui / CopyButton.jsx View on Github external
function reportException(ex) {
    alertFail("Sorry your browser doesn't support this feature", "Can't Copy");
    // take Mulder's advice - trustno1
    if (Raven && Raven.isSetup()) {
        if (Raven.captureException) {
            Raven.captureException(ex);
        }
    }
}
github assembl / assembl / assembl / static / js / app / utils / scrollUtils.js View on Github external
if(debugScrollUtils) {
          console.log("scrollUtils::scrollToElement(): POST_RETRY Final viewPort offset: ", getElementViewportOffset(el, scrollableElement), ", difference to target offset: ", getElementViewportOffset(el, scrollableElement) - desiredViewportOffset, " target scrollTop was ", scrollTarget, "final scrollTop is ", scrollableElement.scrollTop());
        }


      }
      if (_.isFunction(callback)) {
        callback();
      }
      if(watch) {
        _watchOffset(el, scrollableElement);
      }
    }
    catch (e) {
      if (sentry_dsn) {
        Raven.captureException(e);
      } else {
        throw e;
      }
    }
  }
github ivantsov / yandex-mail-notifier / src / pages / raven.js View on Github external
window.onunhandledrejection = (err) => {
  Raven.captureException(err.reason);
};
github department-of-veterans-affairs / vets-website / src / applications / common / schemaform / actions.js View on Github external
const captureError = (error, errorType) => {
    Raven.captureException(error, {
      fingerprint: [formConfig.trackingPrefix, error.message],
      extra: {
        errorType,
        statusText: error.statusText
      }
    });
    recordEvent({
      event: `${formConfig.trackingPrefix}-submission-failed${errorType.startsWith('client') ? '-client' : ''}`,
    });
  };
github javallone / regexper-static / src / components / RavenError / index.js View on Github external
componentDidMount() {
    const { error, details } = this.props;
    Raven.captureException(error, details);
  }
github wasd171 / chatinder / src / app / stores / State / State.ts View on Github external
notifier.notify({
									title: newMatch.person.name,
									body: message.message
								})
							}
						})

						this.matches.set(newMatch._id, newMatch)
						if (!silent) {
							notifier.notify({
								title: newMatch.person.name,
								body: 'You have a new match!'
							})
						}
					} catch (err) {
						Raven.captureException(err)
					}
				} else {
					oldMatch.update(match)
				}
			})
github mozilla-frontend-infra / firefox-health-dashboard / src / vendor / errors.jsx View on Github external
const reportOrLog = (error, info) => {
  if (process.env.NODE_ENV === 'production') {
    Raven.captureException(error);
  }

  if (info) {
    if (process.env.NODE_ENV === 'production') {
      Raven.captureMessage(info);
    }
  }
};