How to use the raven-js.lastEventId 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 commercetools / merchant-center-application-kit / src / middleware / sentry-tracking.js View on Github external
) {
    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: {
          ...action.payload.values,
          errorId,
github itdagene-ntnu / itdagene-webapp / components / ErrorBoundary / index.js View on Github external
openDialog = () => {
    Raven.lastEventId() && Raven.showReportDialog({});
  };
github AJInteractive / InterviewJS / packages / composer / src / partials / util / ErrorBoundary.js View on Github external
        <div> Raven.lastEventId() &amp;&amp; Raven.showReportDialog()}&gt;
          <p>We’re sorry — something’s gone wrong.</p></div>
github itdagene-ntnu / itdagene-webapp / components / ErrorBoundary / index.js View on Github external
return React.Children.map(children, child =&gt;
        React.cloneElement(child, { ...rest })
      );
    }
    if (hidden) {
      return null;
    }

    return (
      <div>
        <div> !openReportDialog &amp;&amp; this.openDialog()}&gt;
          <div>
            <h3>En feil har oppstått</h3>
            <p>
              Webansvarling har fått beskjed om feilen.{' '}
              {!openReportDialog &amp;&amp; Raven.lastEventId() &amp;&amp; (
                <span>
                  Klikk <b>her</b> for å sende en rapport.
                </span>
              )}
            </p>
          </div>
        </div>
      </div>
    );
  }
}
github mprove-io / mprove / src / app / services / my-error-handler.service.ts View on Github external
handleError(err: any): void {
    if (!err.data) {
      err.name = `[MyErrorHandler] ${err.message}`;
      err.message = `[MyErrorHandler] ${err.message}: -`;

      err.data = {
        name: err.name,
        message: '-'
      };
    }

    if (environment.canUseRaven === true) {
      Raven.captureException(err);
      err.data.event_id = Raven.lastEventId();
    }

    let openDialogs = this.dialog.openDialogs;

    if (openDialogs.length &lt; 5) {
      this.ngZone.run(() =&gt; {
        this.myDialogService.showErDialog({ error: err });
      });
    }

    super.handleError(err);
  }
}
github Jigsaw-Code / outline-client / src / www / app / cordova_main.ts View on Github external
return super.report(userFeedback, feedbackCategory, userEmail).then(() => {
      return cordova.plugins.outline.log.send(Raven.lastEventId());
    });
  }
github javallone / regexper-static / src / components / RavenError / index.js View on Github external
reportError = event => {
    event.preventDefault();

    if (Raven.lastEventId()) {
      Raven.showReportDialog();
    }
  }
github hand-dot / taskontable / src / containers / ErrorBoundary.js View on Github external
                onClick={() => Raven.lastEventId() && Raven.showReportDialog()}
                variant="contained"
github nusmodifications / nusmods / v3 / src / js / views / venues / VenuesContainer.jsx View on Github external
render() {
    const {
      isMenuOpen,
      searchTerm,
      selectedVenue,
      loading,
      error,
      isAvailabilityEnabled,
      searchOptions,
    } = this.state;

    if (error) {
      return ;
    }

    if (loading) {
      return (
        <div>
          {pageHead}
          
        </div>
      );
    }

    let venues = searchVenue(this.state.venues, searchTerm);
    const unfilteredCount = size(venues);

    if (isAvailabilityEnabled) {
      venues = filterAvailability(venues, searchOptions);
github nusmodifications / nusmods / v3 / src / js / views / modules / ModulePageContainer.jsx View on Github external
render() {
    const { ModulePageContent, error } = this.state;
    const { module, moduleCode, match } = this.props;

    if (!this.doesModuleExist(moduleCode)) {
      return ;
    }

    if (error) {
      return ;
    }

    if (module &amp;&amp; match.url !== this.canonicalUrl()) {
      return ;
    }

    if (module &amp;&amp; ModulePageContent) {
      return ;
    }

    return ;
  }
}