Comparing version 1.4.1 to 1.4.2
@@ -151,3 +151,7 @@ 'use strict'; | ||
// https://github.com/rollbar/node_rollbar/blob/a03b3a6e6e0a2734e2657cbf41e21927003f505d/lib/notifier.js#L359 | ||
rollbar.handleErrorWithPayloadData(err, { custom: (err.data || {}) }, req, cb); | ||
var payload = { | ||
level: err.level || 'error', | ||
custom: err.data || {} | ||
}; | ||
rollbar.handleErrorWithPayloadData(err, payload, req, cb); | ||
}; | ||
@@ -154,0 +158,0 @@ |
{ | ||
"name": "error-cat", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "A friendly feline companion that helps you create, track, and report errors.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -443,3 +443,3 @@ 'use strict'; | ||
error.report(err); | ||
var expected = { custom: err.data }; | ||
var expected = { level: 'error', custom: err.data }; | ||
expect(rollbar.handleErrorWithPayloadData.firstCall.args[1]) | ||
@@ -453,6 +453,23 @@ .to.deep.equal(expected); | ||
expect(rollbar.handleErrorWithPayloadData.firstCall.args[1]) | ||
.to.deep.equal({ custom: {} }); | ||
.to.deep.equal({ level: 'error', custom: {} }); | ||
done(); | ||
}); | ||
it('should set level if provided', function(done) { | ||
var testError = new Error('Some message'); | ||
testError.level = 'warning'; | ||
error.report(testError); | ||
expect(rollbar.handleErrorWithPayloadData.firstCall.args[1]) | ||
.to.deep.equal({ level: 'warning', custom: {} }); | ||
done(); | ||
}); | ||
it('should use `error` as default level', function(done) { | ||
var testError = new Error('Some message'); | ||
error.report(testError); | ||
expect(rollbar.handleErrorWithPayloadData.firstCall.args[1]) | ||
.to.deep.equal({ level: 'error', custom: {} }); | ||
done(); | ||
}); | ||
it('should do nothing when rollbar is unavailable', function(done) { | ||
@@ -459,0 +476,0 @@ error.canUseRollbar.returns(false); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27413
594
0