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.
package/dist/rollbar.js CHANGED
@@ -1084,11 +1084,11 @@ function Stack(exception, skip) {
1084
1084
  function parse(e, skip) {
1085
1085
  var err = e;
1086
1086
 
1087
- if (err.nested) {
1087
+ if (err.nested || err.cause) {
1088
1088
  var traceChain = [];
1089
1089
  while (err) {
1090
1090
  traceChain.push(new Stack(err, skip));
1091
- err = err.nested;
1091
+ err = err.nested || err.cause;
1092
1092
 
1093
1093
  skip = 0; // Only apply skip value to primary error
1094
1094
  }
@@ -3545,8 +3545,8 @@ function addErrorContext(item) {
3545
3545
 
3546
3546
  chain.push(err);
3547
3547
 
3548
- while (err.nested) {
3549
- err = err.nested;
3548
+ while (err.nested || err.cause) {
3549
+ err = err.nested || err.cause;
3550
3550
  chain.push(err);
3551
3551
  }
3552
3552
 
@@ -4579,7 +4579,7 @@ module.exports = {
4579
4579
 
4580
4580
 
4581
4581
  module.exports = {
4582
- version: '2.24.1',
4582
+ version: '2.25.0',
4583
4583
  endpoint: 'api.rollbar.com/api/1/item/',
4584
4584
  logLevel: 'debug',
4585
4585
  reportLevel: 'debug',
@@ -5255,8 +5255,10 @@ Instrumenter.prototype.instrumentNetwork = function() {
5255
5255
  // Test to ensure body is a Promise, which it should always be.
5256
5256
  if (typeof body.then === 'function') {
5257
5257
  body.then(function (text) {
5258
- if (self.isJsonContentType(metadata.response_content_type)) {
5258
+ if (text && self.isJsonContentType(metadata.response_content_type)) {
5259
5259
  metadata.response.body = self.scrubJson(text);
5260
+ } else {
5261
+ metadata.response.body = text;
5260
5262
  }
5261
5263
  });
5262
5264
  } else {
@@ -5581,16 +5583,16 @@ Instrumenter.prototype.handleCspError = function(message) {
5581
5583
  }
5582
5584
 
5583
5585
  Instrumenter.prototype.deinstrumentContentSecurityPolicy = function() {
5584
- if (!('addEventListener' in this._window)) { return; }
5586
+ if (!('addEventListener' in this._document)) { return; }
5585
5587
 
5586
5588
  this.removeListeners('contentsecuritypolicy');
5587
5589
  };
5588
5590
 
5589
5591
  Instrumenter.prototype.instrumentContentSecurityPolicy = function() {
5590
- if (!('addEventListener' in this._window)) { return; }
5592
+ if (!('addEventListener' in this._document)) { return; }
5591
5593
 
5592
5594
  var cspHandler = this.handleCspEvent.bind(this);
5593
- this.addListener('contentsecuritypolicy', this._window, 'securitypolicyviolation', null, cspHandler, false);
5595
+ this.addListener('contentsecuritypolicy', this._document, 'securitypolicyviolation', null, cspHandler, false);
5594
5596
  };
5595
5597
 
5596
5598
  Instrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {