sentry-node
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -86,3 +86,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Sentry.prototype.error = function(err, logger, culprit, extra) { | ||
Sentry.prototype.error = function(err, logger, culprit, extra, cb) { | ||
var data; | ||
@@ -111,6 +111,6 @@ if (extra == null) { | ||
} | ||
return this._send(data); | ||
return this._send(data, cb); | ||
}; | ||
Sentry.prototype.message = function(message, logger, extra) { | ||
Sentry.prototype.message = function(message, logger, extra, cb) { | ||
var data; | ||
@@ -126,10 +126,15 @@ if (extra == null) { | ||
}; | ||
return this._send(data); | ||
return this._send(data, cb); | ||
}; | ||
Sentry.prototype._send = function(data) { | ||
Sentry.prototype._send = function(data, cb) { | ||
var options, | ||
_this = this; | ||
if (cb == null) { | ||
cb = function() {}; | ||
} | ||
if (!this.enabled) { | ||
return console.log(this.disable_message); | ||
this.emit("done"); | ||
console.log(this.disable_message); | ||
return setImmediate(cb); | ||
} | ||
@@ -160,10 +165,14 @@ if ((data.logger != null) && !_.isString(data.logger)) { | ||
var _ref; | ||
_this.emit("done"); | ||
if ((err != null) || res.statusCode > 299) { | ||
if ((_ref = res.statusCode) === 429 || _ref === 413) { | ||
return _handle_http_load_errors(_this, err); | ||
_handle_http_load_errors(_this, err); | ||
return cb(err || new Error("status code: " + res.statusCode)); | ||
} | ||
console.error('Error posting event to Sentry:', err, body); | ||
return _this.emit("error", err); | ||
_this.emit("error", err); | ||
return cb(err || new Error("status code: " + res.statusCode)); | ||
} else { | ||
return _this.emit("logged"); | ||
_this.emit("logged"); | ||
return cb(); | ||
} | ||
@@ -170,0 +179,0 @@ }); |
{ | ||
"name": "sentry-node", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "simple Node wrapper around Sentry API", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
49058
225
4