@tinypudding/puddy-lib
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -1,6 +0,6 @@ | ||
module.exports = function (callback) { | ||
module.exports = function (callback, skipNotFound = false) { | ||
return function (err, req, res, next) { | ||
// treat as 404 | ||
if (err.message | ||
if (!skipNotFound && err.message | ||
&& (~err.message.indexOf('not found') | ||
@@ -11,10 +11,4 @@ || (~err.message.indexOf('Cast to ObjectId failed')))) { | ||
//if request accept html request | ||
if (req.accepts('html')) { | ||
callback(req, res, next, { type: 'html', code: err.status, path: req.url, originalUrl: req.originalUrl, err: err }); | ||
} else { | ||
callback(req, res, next, { code: err.status, path: req.url, originalUrl: req.originalUrl, err: err }); | ||
} | ||
// Complete | ||
callback(req, res, next, { code: err.status, path: req.url, originalUrl: req.originalUrl, err: err }); | ||
return; | ||
@@ -21,0 +15,0 @@ |
{ | ||
"name": "@tinypudding/puddy-lib", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Essential codes to run the other repositories from the Tiny Pudding Account.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
59825
792