rollbar 2.24.1 → 2.25.0

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.
@@ -1094,11 +1094,11 @@ function Stack(exception, skip) {
1094
1094
  function parse(e, skip) {
1095
1095
  var err = e;
1096
1096
 
1097
- if (err.nested) {
1097
+ if (err.nested || err.cause) {
1098
1098
  var traceChain = [];
1099
1099
  while (err) {
1100
1100
  traceChain.push(new Stack(err, skip));
1101
- err = err.nested;
1101
+ err = err.nested || err.cause;
1102
1102
 
1103
1103
  skip = 0; // Only apply skip value to primary error
1104
1104
  }
@@ -3547,8 +3547,8 @@ function addErrorContext(item) {
3547
3547
 
3548
3548
  chain.push(err);
3549
3549
 
3550
- while (err.nested) {
3551
- err = err.nested;
3550
+ while (err.nested || err.cause) {
3551
+ err = err.nested || err.cause;
3552
3552
  chain.push(err);
3553
3553
  }
3554
3554
 
@@ -4581,7 +4581,7 @@ module.exports = {
4581
4581
 
4582
4582
 
4583
4583
  module.exports = {
4584
- version: '2.24.1',
4584
+ version: '2.25.0',
4585
4585
  endpoint: 'api.rollbar.com/api/1/item/',
4586
4586
  logLevel: 'debug',
4587
4587
  reportLevel: 'debug',
@@ -5257,8 +5257,10 @@ Instrumenter.prototype.instrumentNetwork = function() {
5257
5257
  // Test to ensure body is a Promise, which it should always be.
5258
5258
  if (typeof body.then === 'function') {
5259
5259
  body.then(function (text) {
5260
- if (self.isJsonContentType(metadata.response_content_type)) {
5260
+ if (text && self.isJsonContentType(metadata.response_content_type)) {
5261
5261
  metadata.response.body = self.scrubJson(text);
5262
+ } else {
5263
+ metadata.response.body = text;
5262
5264
  }
5263
5265
  });
5264
5266
  } else {
@@ -5583,16 +5585,16 @@ Instrumenter.prototype.handleCspError = function(message) {
5583
5585
  }
5584
5586
 
5585
5587
  Instrumenter.prototype.deinstrumentContentSecurityPolicy = function() {
5586
- if (!('addEventListener' in this._window)) { return; }
5588
+ if (!('addEventListener' in this._document)) { return; }
5587
5589
 
5588
5590
  this.removeListeners('contentsecuritypolicy');
5589
5591
  };
5590
5592
 
5591
5593
  Instrumenter.prototype.instrumentContentSecurityPolicy = function() {
5592
- if (!('addEventListener' in this._window)) { return; }
5594
+ if (!('addEventListener' in this._document)) { return; }
5593
5595
 
5594
5596
  var cspHandler = this.handleCspEvent.bind(this);
5595
- this.addListener('contentsecuritypolicy', this._window, 'securitypolicyviolation', null, cspHandler, false);
5597
+ this.addListener('contentsecuritypolicy', this._document, 'securitypolicyviolation', null, cspHandler, false);
5596
5598
  };
5597
5599
 
5598
5600
  Instrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {