How to use the rollbar.reportMessageWithPayloadData function in rollbar

To help you get started, we’ve selected a few rollbar 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 JustFixNYC / tenants / app / services / address.server.service.js View on Github external
}, function (error, response, body) {

    if(error) {
      geoclient.reject('[GEOCLIENT ERROR - 0] ' + error);
    } else if(!error && response.statusCode === 200) {

      // check out the response
      var json = JSON.parse(body).address;

      // address not found in geoclient
      if(json.geosupportReturnCode !== '00' && json.geosupportReturnCode !== '01')  {
        geoclient.reject('[GEOCLIENT ERROR - 1] ' + json.message);
      } else if(!json.bbl || json.bbl === '' ||
                !json.latitudeInternalLabel || json.latitudeInternalLabel === '' ||
                !json.longitudeInternalLabel || json.longitudeInternalLabel === '') {
        rollbar.reportMessageWithPayloadData("Geoclient failed.", { level: "warning", addr: addr, boro: boro });
      }

      // address found in geoclient
      var geo =  {
          bbl : json.bbl,
          lon : json.longitudeInternalLabel,
          lat : json.latitudeInternalLabel,
          streetNum : json.houseNumber,
          streetName : json.streetName1In,
          bCode : json.boroughCode1In,
          bUSPS : json.uspsPreferredCityName,
          zip : json.zipCode,
          cd: json.communityDistrict,
          bin : json.giBuildingIdentificationNumber1
        };
      geoclient.resolve(geo);