http-errors
Advanced tools
Comparing version 1.2.7 to 1.2.8
14
index.js
@@ -5,3 +5,3 @@ | ||
exports = module.exports = function () { | ||
exports = module.exports = function httpError() { | ||
// so much arity going on ~_~ | ||
@@ -33,3 +33,9 @@ var err; | ||
if (typeof status !== 'number' || !statuses[status]) status = 500; | ||
err = err || new Error(msg || statuses[status]); | ||
if (!err) { | ||
// create error | ||
err = new Error(msg || statuses[status]) | ||
Error.captureStackTrace(err, httpError) | ||
} | ||
err.expose = status < 500; | ||
@@ -50,3 +56,3 @@ for (var key in props) err[key] = props[key]; | ||
var self = new Error(msg != null ? msg : statuses[code]) | ||
Error.captureStackTrace(self, arguments.callee) | ||
Error.captureStackTrace(self, ServerError) | ||
self.__proto__ = ServerError.prototype | ||
@@ -66,3 +72,3 @@ return self | ||
var self = new Error(msg != null ? msg : statuses[code]) | ||
Error.captureStackTrace(self, arguments.callee) | ||
Error.captureStackTrace(self, ClientError) | ||
self.__proto__ = ClientError.prototype | ||
@@ -69,0 +75,0 @@ return self |
{ | ||
"name": "http-errors", | ||
"description": "Create HTTP error objects", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"author": { | ||
@@ -35,4 +35,6 @@ "name": "Jonathan Ong", | ||
"index.js", | ||
"LICENSE" | ||
"HISTORY.md", | ||
"LICENSE", | ||
"README.md" | ||
] | ||
} |
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
7028
5
72
1