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.
@@ -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
  }
@@ -3552,8 +3552,8 @@ function addErrorContext(item) {
3552
3552
 
3553
3553
  chain.push(err);
3554
3554
 
3555
- while (err.nested) {
3556
- err = err.nested;
3555
+ while (err.nested || err.cause) {
3556
+ err = err.nested || err.cause;
3557
3557
  chain.push(err);
3558
3558
  }
3559
3559
 
@@ -4586,7 +4586,7 @@ module.exports = {
4586
4586
 
4587
4587
 
4588
4588
  module.exports = {
4589
- version: '2.24.1',
4589
+ version: '2.25.0',
4590
4590
  endpoint: 'api.rollbar.com/api/1/item/',
4591
4591
  logLevel: 'debug',
4592
4592
  reportLevel: 'debug',
@@ -5262,8 +5262,10 @@ Instrumenter.prototype.instrumentNetwork = function() {
5262
5262
  // Test to ensure body is a Promise, which it should always be.
5263
5263
  if (typeof body.then === 'function') {
5264
5264
  body.then(function (text) {
5265
- if (self.isJsonContentType(metadata.response_content_type)) {
5265
+ if (text && self.isJsonContentType(metadata.response_content_type)) {
5266
5266
  metadata.response.body = self.scrubJson(text);
5267
+ } else {
5268
+ metadata.response.body = text;
5267
5269
  }
5268
5270
  });
5269
5271
  } else {
@@ -5588,16 +5590,16 @@ Instrumenter.prototype.handleCspError = function(message) {
5588
5590
  }
5589
5591
 
5590
5592
  Instrumenter.prototype.deinstrumentContentSecurityPolicy = function() {
5591
- if (!('addEventListener' in this._window)) { return; }
5593
+ if (!('addEventListener' in this._document)) { return; }
5592
5594
 
5593
5595
  this.removeListeners('contentsecuritypolicy');
5594
5596
  };
5595
5597
 
5596
5598
  Instrumenter.prototype.instrumentContentSecurityPolicy = function() {
5597
- if (!('addEventListener' in this._window)) { return; }
5599
+ if (!('addEventListener' in this._document)) { return; }
5598
5600
 
5599
5601
  var cspHandler = this.handleCspEvent.bind(this);
5600
- this.addListener('contentsecuritypolicy', this._window, 'securitypolicyviolation', null, cspHandler, false);
5602
+ this.addListener('contentsecuritypolicy', this._document, 'securitypolicyviolation', null, cspHandler, false);
5601
5603
  };
5602
5604
 
5603
5605
  Instrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {