Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-better-error-handler

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-better-error-handler - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

.nyc_output/36562beb-31c0-4d8d-9ab7-05040b9596d1.json

15

lib/index.js

@@ -213,11 +213,18 @@ 'use strict';

// translate messages
const translate = message => _.isFunction(ctx.request.t) ? ctx.request.t(message) : message;
// loop over the errors object of the Validation Error
// with support for HTML error lists
if (_.values(err.errors).length === 1) {
err.message = _.values(err.errors)[0].message;
err.message = translate(_.values(err.errors)[0].message);
} else {
const errors = _.map(_.values(err.errors), 'message');
err.message = ctx.api ? errors.join(', ') : `<ul class="text-xs-left mb-0"><li>${errors.join('</li><li>')}</li></ul>`;
const errors = _.map(_.map(_.values(err.errors), 'message'), translate);
err.message = ctx.api ? errors.join(', ') : `<ul class="text-left mb-0"><li>${errors.join('</li><li>')}</li></ul>`;
}
// this ensures the error shows up client-side
err.status = 400;
err.statusCode = 400;
return err;

@@ -227,2 +234,2 @@ }

module.exports = errorHandler;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJlcnIiLCJfIiwiaXNFcnJvciIsIkVycm9yIiwidHlwZSIsImFjY2VwdHMiLCJkZWJ1ZyIsInN0YXR1cyIsIm1lc3NhZ2UiLCJCb29tIiwibm90QWNjZXB0YWJsZSIsIm91dHB1dCIsInBheWxvYWQiLCJwYXJzZVZhbGlkYXRpb25FcnJvciIsInZhbCIsInBhcnNlSW50IiwiaXNOdW1iZXIiLCJjcmVhdGUiLCJpc09iamVjdCIsInN0YXR1c0NvZGUiLCJoYXNGbGFzaCIsImlzRnVuY3Rpb24iLCJmbGFzaCIsImhhc1Nlc3Npb25zI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uge1xuICAgIGNvbnN0IGVycm9ycyA9IF8ubWFwKF8udmFsdWVzKGVyci5lcnJvcnMpLCAnbWVzc2FnZScpO1xuICAgIGVyci5tZXNzYWdlID0gY3R4LmFwaVxuICAgICAgPyBlcnJvcnMuam9pbignLCAnKVxuICAgICAgOiBgPHVsIGNsYXNzPVwidGV4dC14cy1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbihcbiAgICAgICAgICAnPC9saT48bGk+J1xuICAgICAgICApfTwvbGk+PC91bD5gO1xuICB9XG5cbiAgcmV0dXJuIGVycjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBlcnJvckhhbmRsZXI7XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJlcnIiLCJfIiwiaXNFcnJvciIsIkVycm9yIiwidHlwZSIsImFjY2VwdHMiLCJkZWJ1ZyIsInN0YXR1cyIsIm1lc3NhZ2UiLCJCb29tIiwibm90QWNjZXB0YWJsZSIsIm91dHB1dCIsInBheWxvYWQiLCJwYXJzZVZhbGlkYXRpb25FcnJvciIsInZhbCIsInBhcnNlSW50IiwiaXNOdW1iZXIiLCJjcmVhdGUiLCJpc09iamVjdCIsInN0YXR1c0NvZGUiLCJoYXNGbGFzaCIsImlzRnVuY3Rpb24iLCJmbGFzaCIsImhhc1Nlc3Npb25zIiwic2Vzc2lvbiIsInNlc3Npb25TdG9yZSIsImlzU3RyaW5nIiwic2Vzc2lvbklkIiwic2V0IiwiaGFzUmVuZGVyIiwicmVuZGVyIiwibm9SZWZlcnJlciIsImdldCIsImhlYWRlclNlbnQiLCJ3cml0YWJsZSIsImJvZHkiLCJoZWFkZXJzIiwiT2JqZWN0Iiwia2V5cyIsImxlbmd0aCIsImFwcCIsImVtaXQiLCJzdGF0ZSIsIm1ldGEiLCJ0aXRsZSIsImVycm9yIiwiZGVzY3JpcH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gICAgIHRoaXMuYm9keSA9IF81MDA7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuYm9keSA9IF81MDA7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIGZsYXNoIGFuIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgaWYgKGhhc0ZsYXNoKSB0aGlzLmZsYXNoKCdlcnJvcicsIGVyci5tZXNzYWdlKTtcblxuICAgICAgICAvLyBUT0RPOiB1bnRpbCB0aGUgaXNzdWUgaXMgcmVzb2x2ZWQsIHdlIG5lZWQgdG8gYWRkIHRoaXMgaGVyZVxuICAgICAgICAvLyA8aHR0cHM6Ly9naXRodWIuY29tL2tvYWpzL2dlbmVyaWMtc2Vzc2lvbi9wdWxsLzk1I2lzc3VlY29tbWVudC0yNDYzMDg1NDQ+XG4gICAgICAgIGlmIChcbiAgICAgICAgICB0aGlzLnNlc3Npb25TdG9yZSAmJlxuICAgICAgICAgIHRoaXMuc2Vzc2lvbklkICYmXG4gICAgICAgICAgdGhpcy5zZXNzaW9uICYmXG4gICAgICAgICAgdGhpcy5zdGF0ZS5jb29raWVzS2V5XG4gICAgICAgICkge1xuICAgICAgICAgIGF3YWl0IGNvXG4gICAgICAgICAgICAud3JhcCh0aGlzLnNlc3Npb25TdG9yZS5zZXQpXG4gICAgICAgICAgICAuY2FsbCh0aGlzLnNlc3Npb25TdG9yZSwgdGhpcy5zZXNzaW9uSWQsIHRoaXMuc2Vzc2lvbik7XG4gICAgICAgICAgdGhpcy5jb29raWVzLnNldChcbiAgICAgICAgICAgIHRoaXMuc3RhdGUuY29va2llc0tleSxcbiAgICAgICAgICAgIHRoaXMuc2Vzc2lvbklkLFxuICAgICAgICAgICAgdGhpcy5zZXNzaW9uLmNvb2tpZVxuICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICAvKlxuICAgICAgICAvLyBpZiB3ZSdyZSB1c2luZyBga29hLXNlc3Npb24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LnQobWVzc2FnZSkgOiBtZXNzYWdlO1xuXG4gIC8vIGxvb3Agb3ZlciB0aGUgZXJyb3JzIG9iamVjdCBvZiB0aGUgVmFsaWRhdGlvbiBFcnJvclxuICAvLyB3aXRoIHN1cHBvcnQgZm9yIEhUTUwgZXJyb3IgbGlzdHNcbiAgaWYgKF8udmFsdWVzKGVyci5lcnJvcnMpLmxlbmd0aCA9PT0gMSkge1xuICAgIGVyci5tZXNzYWdlID0gdHJhbnNsYXRlKF8udmFsdWVzKGVyci5lcnJvcnMpWzBdLm1lc3NhZ2UpO1xuICB9IGVsc2Uge1xuICAgIGNvbnN0IGVycm9ycyA9IF8ubWFwKF8ubWFwKF8udmFsdWVzKGVyci5lcnJvcnMpLCAnbWVzc2FnZScpLCB0cmFuc2xhdGUpO1xuICAgIGVyci5tZXNzYWdlID0gY3R4LmFwaVxuICAgICAgPyBlcnJvcnMuam9pbignLCAnKVxuICAgICAgOiBgPHVsIGNsYXNzPVwidGV4dC1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbignPC9saT48bGk+Jyl9PC9saT48L3VsPmA7XG4gIH1cblxuICAvLyB0aGlzIGVuc3VyZXMgdGhlIGVycm9yIHNob3dzIHVwIGNsaWVudC1zaWRlXG4gIGVyci5zdGF0dXMgPSA0MDA7XG4gIGVyci5zdGF0dXNDb2RlID0gNDAwO1xuXG4gIHJldHVybiBlcnI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZXJyb3JIYW5kbGVyO1xuIl19
{
"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": "2.0.0",
"version": "3.0.0",
"author": "Nick Baugh <niftylettuce@gmail.com>",

@@ -12,2 +12,5 @@ "bugs": "https://github.com/ladjs/koa-better-error-handler/issues",

},
"contributors": [
"Nick Baugh <niftylettuce@gmail.com>"
],
"dependencies": {

@@ -17,18 +20,18 @@ "boom": "5.1.0",

"debug": "^4.1.1",
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"underscore.string": "^3.3.5"
},
"devDependencies": {
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"ava": "^1.4.0",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"ava": "^2.3.0",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"codecov": "^3.2.0",
"cross-env": "^5.2.0",
"eslint": "^5.15.3",
"codecov": "^3.5.0",
"cross-env": "^5.2.1",
"eslint": "^6.3.0",
"eslint-config-xo-lass": "^1.0.3",
"fixpack": "^2.3.1",
"husky": "^1.3.1",
"koa": "^2.7.0",
"husky": "^3.0.5",
"koa": "^2.8.1",
"koa-404-handler": "^0.0.2",

@@ -39,9 +42,9 @@ "koa-basic-auth": "https://github.com/niftylettuce/basic-auth",

"koa-generic-session": "^2.0.1",
"koa-redis": "^3.1.3",
"koa-redis": "^4.0.0",
"koa-router": "^7.4.0",
"lint-staged": "^8.1.5",
"nyc": "^13.3.0",
"lint-staged": "^9.2.5",
"nyc": "^14.1.1",
"redis": "^2.8.0",
"remark-cli": "^6.0.1",
"remark-preset-github": "^0.0.13",
"remark-cli": "^7.0.0",
"remark-preset-github": "^0.0.16",
"supertest": "^4.0.2",

@@ -48,0 +51,0 @@ "xo": "^0.24.0"

@@ -194,3 +194,3 @@ # koa-better-error-handler

"error": "Bad Request",
"message": "<ul class=\"text-xs-left mb-0\"><li>Path `company_logo` is required.</li><li>Gig description must be 100-300 characters.</li></ul>"
"message": "<ul class=\"text-left mb-0\"><li>Path `company_logo` is required.</li><li>Gig description must be 100-300 characters.</li></ul>"
}

@@ -197,0 +197,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc