How to use the raven-js.captureMessage 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 assembl / assembl / assembl / static / js / app / views / baseMessageList.js View on Github external
console.log("scrollToMessage called with args:", messageModel.id, shouldHighlightMessageSelected, shouldOpenMessageSelected, callback, failedCallback, recursionDepth, originalRenderId);
      }

      recursionDepth = recursionDepth || 0;
      originalRenderId = originalRenderId || _.clone(this._renderId);
      var RETRY_INTERVAL = Math.floor(200 * Math.log(2 + recursionDepth));  // increasing interval

      shouldHighlightMessageSelected = (typeof shouldHighlightMessageSelected === "undefined") ? true : shouldHighlightMessageSelected;
      shouldOpenMessageSelected = (typeof shouldOpenMessageSelected === "undefined") ? true : shouldOpenMessageSelected;

      if (!messageModel) {
        throw new Error("scrollToMessage(): ERROR:  messageModel wasn't provided");
      }

      if (recursionDepth === 0 && this._scrollToMessageInProgressId) {
        Raven.captureMessage("scrollToMessage():  a scrollToMessage was already in progress, aborting", {message_id: messageModel.id})
        if (_.isFunction(failedCallback)) {
          failedCallback();
        }

        return;
      }
      else if (originalRenderId !== this._renderId) {
        //This is a normal condition now
        //console.log("scrollToMessage():  obsolete render, aborting for ", messageModel.id);
        //Raven.captureMessage("scrollToMessage():  obsolete render, aborting", {message_id: messageModel.id})
        if (this._scrollToMessageInProgressId === originalRenderId) {
          this._scrollToMessageInProgressId = false;
        }

        if (_.isFunction(failedCallback)) {
          failedCallback();
github cyverse / troposphere / troposphere / static / js / actions / instance / updateAllocationSource.js View on Github external
p.catch(response => {
        let err = `Assigning allocation source: "${allocationName}" to "${instanceName}" failed`;

        NotificationController.error("Error assigning allocation source", err);
        if (Raven.isSetup()) {
            Raven.captureMessage(err);
        }

        // Components that are using an optimistic version of instance, need
        // to get sent the latest version of instance without the optimistic
        // change to allocation_source
        Utils.dispatch(InstanceConstants.UPDATE_INSTANCE, {instance});
    });
github cyverse / troposphere / troposphere / static / js / utilities / capture.js View on Github external
const captureMessage = (message, data) => {
    // only call if we have a configuration client available
    if (Raven && Raven.isSetup()) {
        Raven.captureMessage(message, {
            extra: data
        });
    }
};
github department-of-veterans-affairs / vets-website / src / js / letters / reducers / index.js View on Github external
newState.isEditingAddress = false;
      return newState;
    }
    case SAVE_ADDRESS_SUCCESS: {
      const newState = Object.assign({}, state, { savePending: false });
      return _.set('address', action.address, newState);
    }
    case SAVE_ADDRESS_FAILURE:
      return { ...state, savePending: false, saveAddressError: true };
    case GET_ADDRESS_COUNTRIES_SUCCESS: {
      let countriesAvailable = true;
      const countryList = action.countries.data.attributes.countries;

      // Log error if the countries response is not what we expect
      if (!Array.isArray(countryList) || countryList.length === 0) {
        Raven.captureMessage(`vets_letters_unexpected_country_response: ${countryList}`);
        countriesAvailable = false;
      }

      return {
        ...state,
        countries: countryList,
        countriesAvailable
      };
    }
    case GET_ADDRESS_COUNTRIES_FAILURE:
      return _.set('countriesAvailable', false, state);
    case GET_ADDRESS_STATES_SUCCESS: {
      let statesAvailable = true;
      const stateList = action.states.data.attributes.states;

      // Log error if the states response is not what we expect
github CenterForOpenScience / osf.io / website / static / js / contribAdder.js View on Github external
}).fail(function (xhr, status, error) {
            self.hide();
            $osf.unblock();
            var errorMessage = lodashGet(xhr, 'responseJSON.message') || ('There was a problem trying to add contributors.' + osfLanguage.REFRESH_OR_SUPPORT);
            $osf.growl('Could not add contributors', errorMessage);
            Raven.captureMessage('Error adding contributors', {
                extra: {
                    url: url,
                    status: status,
                    error: error
                }
            });
        });
    },
github CenterForOpenScience / osf.io / website / addons / dataverse / static / dataverseUserConfig.js View on Github external
}).fail(function(xhr, textStatus, error) {
            var errorMessage = (xhr.status === 401) ? language.authInvalid : language.authError;
            self.changeMessage(errorMessage, 'text-danger');
            Raven.captureMessage('Could not authenticate with Dataverse', {
                extra: {
                    url: url,
                    textStatus: textStatus,
                    error: error
                }
            });
        });
    };
github bayesimpact / bob-emploi / frontend / client / src / components / theme.tsx View on Github external
private handleError = (): void => {
    if (!this.state.hasErred && this.imgRef.current) {
      const src = this.imgRef.current.src
      if (Raven.captureMessage && !missingImages.has(src)) {
        Raven.captureMessage(`Image source is no longer available: ${src}.`)
        missingImages.add(src)
      }
      const {fallbackSrc} = this.props
      if (fallbackSrc) {
        this.imgRef.current.src = fallbackSrc
      }
      this.setState({hasErred: true})
    }
  }
github department-of-veterans-affairs / vets-website / src / applications / auth / containers / AuthApp.jsx View on Github external
reportSentryErrors = () => {
    if (!Object.keys(this.userProfile).length) {
      Raven.captureMessage('Unexpected response for user object');
    } else if (!this.serviceName) {
      Raven.captureMessage('Missing serviceName in user object');
    }
  };
github CenterForOpenScience / osf.io / website / static / js / components / quickFiles.js View on Github external
}, function(xhr, textStatus, error) {
            ctrl.failed = true;
            ctrl.requestPending(false);
            m.redraw();
            Raven.captureMessage('Error retrieving quickfiles', {
                extra: {
                    url: url,
                    textStatus: textStatus,
                    error: error
                }
            });
        }
    );
github CenterForOpenScience / osf.io / website / static / js / citation-settings.js View on Github external
}).fail(function(xhr, status, error) {
            Raven.captureMessage('Error while updating addon account', {
                url: url, status: status, error: error
            });
        });
    }