@vitrical/utils
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -9,3 +9,3 @@ "use strict"; | ||
return next(); | ||
if ((0, api_1.isApiError)(err)) { | ||
if (err instanceof api_1.ApiError) { | ||
console.warn(err.message); | ||
@@ -17,17 +17,17 @@ console.warn(err.stack); | ||
}); | ||
return; | ||
} | ||
else if ((0, validation_1.objectHasProperty)(err, 'message')) { | ||
else if (typeof err === 'object' && 'message' in err && 'stack' in err) { | ||
console.error(err.message); | ||
console.error(err.stack); | ||
res.status(500).send({ | ||
msg: err.message | ||
msg: err.message + '' | ||
}); | ||
return; | ||
} | ||
else { | ||
console.error(err); | ||
res.status((0, api_1.isApiError)(err) ? err.status : 500).send({ | ||
msg: 'Unknown Error', | ||
err: err | ||
}); | ||
} | ||
console.error(err); | ||
res.status(500).send({ | ||
msg: 'Unknown Error', | ||
err: err | ||
}); | ||
}; | ||
@@ -34,0 +34,0 @@ exports.handleExpressError = handleExpressError; |
{ | ||
"name": "@vitrical/utils", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "Collection of useful functions and typings", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"build": "tsc --project tsconfig.json", | ||
"test": "ts-node validation.ts" | ||
"clean": "rm *.ts" | ||
}, | ||
@@ -11,0 +11,0 @@ "repository": { |
@@ -14,3 +14,3 @@ { | ||
"include": ["**/*.ts"], | ||
"exclude": ["node_modules"] | ||
"exclude": ["node_modules", "**/node_modules"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
37129
15
509