rollbar 2.26.0 → 2.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1884,6 +1884,7 @@ function addTransformsToNotifier(notifier, rollbar, gWindow) {
1884
1884
  .addTransform(sharedTransforms.addTelemetryData)
1885
1885
  .addTransform(sharedTransforms.addConfigToPayload)
1886
1886
  .addTransform(transforms.addScrubber(rollbar.scrub))
1887
+ .addTransform(sharedTransforms.addPayloadOptions)
1887
1888
  .addTransform(sharedTransforms.userTransform(logger))
1888
1889
  .addTransform(sharedTransforms.addConfiguredOptions)
1889
1890
  .addTransform(sharedTransforms.addDiagnosticKeys)
@@ -3344,8 +3345,9 @@ Transport.prototype._makeZoneRequest = function () {
3344
3345
 
3345
3346
  if (currentZone && currentZone._name === 'angular') {
3346
3347
  var rootZone = currentZone._parent;
3348
+ var self = this;
3347
3349
  rootZone.run(function () {
3348
- this._makeRequest.apply(undefined, args);
3350
+ self._makeRequest.apply(undefined, args);
3349
3351
  });
3350
3352
  } else {
3351
3353
  this._makeRequest.apply(undefined, args);
@@ -3397,7 +3399,7 @@ function makeFetchRequest(accessToken, url, method, data, callback, timeout) {
3397
3399
 
3398
3400
  if(_.isFiniteNumber(timeout)) {
3399
3401
  controller = new AbortController();
3400
- timeoutId = setTimeout(() => controller.abort(), timeout);
3402
+ timeoutId = setTimeout(function () {controller.abort()}, timeout);
3401
3403
  }
3402
3404
 
3403
3405
  fetch(url, {
@@ -3409,14 +3411,14 @@ function makeFetchRequest(accessToken, url, method, data, callback, timeout) {
3409
3411
  },
3410
3412
  body: data,
3411
3413
  })
3412
- .then((response) => {
3414
+ .then(function (response) {
3413
3415
  if (timeoutId) clearTimeout(timeoutId);
3414
3416
  return response.json();
3415
3417
  })
3416
- .then((data) => {
3418
+ .then(function (data) {
3417
3419
  callback(null, data);
3418
3420
  })
3419
- .catch((error) => {
3421
+ .catch(function (error) {
3420
3422
  logger.error(error.message);
3421
3423
  callback(error);
3422
3424
  });
@@ -4305,12 +4307,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
4305
4307
  var _ = __webpack_require__(0);
4306
4308
 
4307
4309
  function itemToPayload(item, options, callback) {
4308
- var payloadOptions = options.payload || {};
4309
- if (payloadOptions.body) {
4310
- delete payloadOptions.body;
4311
- }
4310
+ var data = item.data;
4312
4311
 
4313
- var data = _.merge(item.data, payloadOptions);
4314
4312
  if (item._isUncaught) {
4315
4313
  data._isUncaught = true;
4316
4314
  }
@@ -4320,6 +4318,16 @@ function itemToPayload(item, options, callback) {
4320
4318
  callback(null, data);
4321
4319
  }
4322
4320
 
4321
+ function addPayloadOptions(item, options, callback) {
4322
+ var payloadOptions = options.payload || {};
4323
+ if (payloadOptions.body) {
4324
+ delete payloadOptions.body;
4325
+ }
4326
+
4327
+ item.data = _.merge(item.data, payloadOptions);
4328
+ callback(null, item);
4329
+ }
4330
+
4323
4331
  function addTelemetryData(item, options, callback) {
4324
4332
  if (item.telemetryEvents) {
4325
4333
  _.set(item, 'data.body.telemetry', item.telemetryEvents);
@@ -4443,6 +4451,7 @@ function addDiagnosticKeys(item, options, callback) {
4443
4451
 
4444
4452
  module.exports = {
4445
4453
  itemToPayload: itemToPayload,
4454
+ addPayloadOptions: addPayloadOptions,
4446
4455
  addTelemetryData: addTelemetryData,
4447
4456
  addMessageWithError: addMessageWithError,
4448
4457
  userTransform: userTransform,
@@ -4683,7 +4692,7 @@ module.exports = {
4683
4692
 
4684
4693
 
4685
4694
  module.exports = {
4686
- version: '2.26.0',
4695
+ version: '2.26.1',
4687
4696
  endpoint: 'api.rollbar.com/api/1/item/',
4688
4697
  logLevel: 'debug',
4689
4698
  reportLevel: 'debug',