Comparing version 0.3.1 to 0.3.2
@@ -15,2 +15,3 @@ var HTTP_STATUS_CODES = require('http').STATUS_CODES; | ||
util.inherits(Airbrake, EventEmitter); | ||
function Airbrake() { | ||
@@ -42,15 +43,18 @@ this.key = null; | ||
Airbrake.prototype.expressHandler = function() { | ||
Airbrake.prototype.expressHandler = function(disableUncaughtException) { | ||
var self = this; | ||
process.on('uncaughtException', function(err) { | ||
self._onError(err, true) | ||
}); | ||
if(!disableUncaughtException) { | ||
process.on('uncaughtException', function(err) { | ||
self._onError(err, true); | ||
}); | ||
} | ||
return function errorHandler(err, req, res, next) { | ||
if (res.statusCode < 400) res.statusCode = 500; | ||
err.url = req.url; | ||
err.component = req.url; | ||
err.action = req.method; | ||
err.params = req.params; | ||
err.params = JSON.stringify(req.body); | ||
err.session = req.session; | ||
@@ -60,4 +64,4 @@ | ||
next(err); | ||
} | ||
} | ||
}; | ||
}; | ||
@@ -83,3 +87,3 @@ Airbrake.prototype._onError = function(err, die) { | ||
}); | ||
} | ||
}; | ||
@@ -89,3 +93,3 @@ Airbrake.prototype.handleExceptions = function() { | ||
process.on('uncaughtException', function(err) { | ||
self._onError(err, true) | ||
self._onError(err, true); | ||
}); | ||
@@ -213,3 +217,3 @@ }; | ||
.up() | ||
.ele('backtrace') | ||
.ele('backtrace'); | ||
@@ -221,3 +225,3 @@ trace.forEach(function(callSite) { | ||
.att('file', callSite.getFileName() || '') | ||
.att('number', callSite.getLineNumber() || '') | ||
.att('number', callSite.getLineNumber() || ''); | ||
}); | ||
@@ -259,5 +263,5 @@ }; | ||
value = vars[key] | ||
value = vars[key]; | ||
if ('string' !== typeof value) { | ||
value = util.inspect(value) | ||
value = util.inspect(value); | ||
} | ||
@@ -299,4 +303,9 @@ | ||
cgiData['process.pid'] = process.pid; | ||
cgiData['process.uid'] = process.getuid(); | ||
cgiData['process.gid'] = process.getgid(); | ||
if(os.platform() != "win32") { | ||
// this two properties are *NIX only | ||
cgiData['process.uid'] = process.getuid(); | ||
cgiData['process.gid'] = process.getgid(); | ||
} | ||
cgiData['process.cwd'] = process.cwd(); | ||
@@ -396,4 +405,4 @@ cgiData['process.execPath'] = process.execPath; | ||
'deploy[scm_revision]': params.rev, | ||
'deploy[scm_repository]': params.repo, | ||
'deploy[scm_repository]': params.repo | ||
}); | ||
}; |
@@ -15,7 +15,8 @@ { | ||
"stefounet <s@fasterize.com> (http://fasterize.com)", | ||
"sreuter <s.reuter@geek-it.de> (https://github.com/sreuterairbrake.io" | ||
"sreuter <s.reuter@geek-it.de> (https://github.com/sreuterairbrake.io", | ||
"Johnny Halife <johnny.halife@me.com> (http://johnny.io)" | ||
], | ||
"name": "airbrake", | ||
"description": "Node.js client for airbrake.io", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/felixge/node-airbrake", | ||
@@ -22,0 +23,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91536
661
4