koa-better-error-handler
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -1,1 +0,1 @@ | ||
{"processes":{"36562beb-31c0-4d8d-9ab7-05040b9596d1":{"parent":null,"children":["66eb6d98-54a0-4420-8c25-ff8ba692c9e9"]},"66eb6d98-54a0-4420-8c25-ff8ba692c9e9":{"parent":"36562beb-31c0-4d8d-9ab7-05040b9596d1","children":[]}},"files":{"/Users/jack/Projects/koa-better-error-handler/lib/index.js":["66eb6d98-54a0-4420-8c25-ff8ba692c9e9"]},"externalIds":{}} | ||
{"processes":{"cda59ecf-3869-44a7-bb6f-25345e876788":{"parent":null,"children":["d48e8d1c-b1f4-4285-a78e-a8721177360c"]},"d48e8d1c-b1f4-4285-a78e-a8721177360c":{"parent":"cda59ecf-3869-44a7-bb6f-25345e876788","children":[]}},"files":{"/Users/jack/Projects/koa-better-error-handler/lib/index.js":["d48e8d1c-b1f4-4285-a78e-a8721177360c"]},"externalIds":{}} |
@@ -196,3 +196,18 @@ 'use strict'; | ||
const passportLocalMongooseErrorNames = ['AuthenticationError', 'MissingPasswordError', 'AttemptTooSoonError', 'TooManyAttemptsError', 'NoSaltValueStoredError', 'IncorrectPasswordError', 'IncorrectUsernameError', 'MissingUsernameError', 'UserExistsError']; | ||
function parseValidationError(ctx, err) { | ||
// translate messages | ||
const translate = message => _.isFunction(ctx.request.t) ? ctx.request.t(message) : message; | ||
// passport-local-mongoose support | ||
if (passportLocalMongooseErrorNames.includes(err.name)) { | ||
err.message = translate(err.message); | ||
// this ensures the error shows up client-side | ||
err.status = 400; | ||
// 429 = too many requests | ||
if (['AttemptTooSoonError', 'TooManyAttemptsError'].includes(err.name)) err.status = 429; | ||
return err; | ||
} | ||
// inspired by https://github.com/syntagma/mongoose-error-helper | ||
@@ -214,5 +229,2 @@ if (err.name !== 'ValidationError') return err; | ||
// translate messages | ||
const translate = message => _.isFunction(ctx.request.t) ? ctx.request.t(message) : message; | ||
// loop over the errors object of the Validation Error | ||
@@ -229,3 +241,2 @@ // with support for HTML error lists | ||
err.status = 400; | ||
err.statusCode = 400; | ||
@@ -236,2 +247,2 @@ return err; | ||
module.exports = errorHandler; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJlcnIiLCJfIiwiaXNFcnJvciIsIkVycm9yIiwidHlwZSIsImFjY2VwdHMiLCJkZWJ1ZyIsInN0YXR1cyIsIm1lc3NhZ2UiLCJCb29tIiwibm90QWNjZXB0YWJsZSIsIm91dHB1dCIsInBheWxvYWQiLCJwYXJzZVZhbGlkYXRpb25FcnJvciIsInZhbCIsInBhcnNlSW50IiwiaXNOdW1iZXIiLCJjcmVhdGUiLCJpc09iamVjdCIsInN0YXR1c0NvZGUiLCJoYXNGbGFzaCIsImlzRnVuY3Rpb24iLCJmbGFzaCIsImhhc1Nlc3Npb25zIiwic2Vzc2lvbiIsInNlc3Npb25TdG9yZSIsImlzU3RyaW5nIiwic2Vzc2lvbklkIiwic2V0IiwiaGFzUmVuZGVyIiwicmVuZGVyIiwibm9SZWZlcnJlciIsImdldCIsImhlYWRlclNlbnQiLCJ3cml0YWJsZSIsImJvZHkiLCJoZWFkZXJzIiwiT2JqZWN0Iiwia2V5cyIsImxlbmd0aCIsImFwcCIsImVtaXQiLCJzdGF0ZSIsIm1ldGEiLCJ0aXRsZSIsImVycm9yIiwiZGVzY3JpcHRpb24iLCJlcnIyIiwiXzQwNCIsIl81MDAiLCJjb29raWVzS2V5IiwiY28iLCJ3cmFwIiwiY2FsbCIsImNvb2tpZXMiLCJjb29raWUiLCJyZWRpcmVjdCIsIkpTT04iLCJzdHJpbmdpZnkiLCJhcGkiLCJCdWZmZXIiLCJieXRlTGVuZ3RoIiwicmVzIiwiZW5kIiwiZXJyb3JIYW5kbGVyIiwiZnMiLCJyZXF1aXJlIiwicGF0aCIsInMiLCJEZWJ1ZyIsIm9wdHMiLCJlbmNvZGluZy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1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbignPC9saT48bGk+Jyl9PC9saT48L3VsPmA7XG4gIH1cblxuICAvLyB0aGlzIGVuc3VyZXMgdGhlIGVycm9yIHNob3dzIHVwIGNsaWVudC1zaWRlXG4gIGVyci5zdGF0dXMgPSA0MDA7XG5cbiAgcmV0dXJuIGVycjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBlcnJvckhhbmRsZXI7XG4iXX0= |
{ | ||
"name": "koa-better-error-handler", | ||
"description": "A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": "Nick Baugh <niftylettuce@gmail.com>", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/ladjs/koa-better-error-handler/issues", |
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
72227
339