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 1.3.6 to 2.0.0

.nyc_output/19584575-dd7d-442c-b91e-5089f17df76f.json

3

examples/api.js

@@ -5,3 +5,3 @@ const Koa = require('koa');

const errorHandler = require('../');
const errorHandler = require('..');

@@ -12,2 +12,3 @@ // initialize our app

// override koa's undocumented error handler
// eslint-disable-next-line unicorn/prefer-add-event-listener
app.context.onerror = errorHandler;

@@ -14,0 +15,0 @@

@@ -10,3 +10,3 @@ const Koa = require('koa');

const errorHandler = require('../');
const errorHandler = require('..');

@@ -42,2 +42,3 @@ // initialize our app

// override koa's undocumented error handler
// eslint-disable-next-line unicorn/prefer-add-event-listener
app.context.onerror = errorHandler;

@@ -44,0 +45,0 @@

@@ -99,3 +99,3 @@ 'use strict';

yield this.render('404');
} catch (err) {
} catch (err2) {
debug('could not find 404 page, using built-in 404 html');

@@ -121,3 +121,3 @@ this.body = _404;

yield this.render('500');
} catch (err) {
} catch (err2) {
debug('could not find 500 page, using built-in 500 html');

@@ -156,2 +156,3 @@ this.body = _500;

}
break;

@@ -163,3 +164,3 @@ case 'json':

default:
this.type = 'text';
this.type = this.api ? 'json' : 'text';
this.body = JSON.stringify(this.body, null, 2);

@@ -210,2 +211,3 @@ break;

}
error.message = error.message.replace(new RegExp(error.path, 'g'), s.humanize(error.path));

@@ -229,2 +231,2 @@ error.message = s.capitalize(error.message);

module.exports = errorHandler;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJlcnIiLCJfIiwiaXNFcnJvciIsIkVycm9yIiwidHlwZSIsImFjY2VwdHMiLCJkZWJ1ZyIsIn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C8vIHdpdGggc3VwcG9ydCBmb3IgSFRNTCBlcnJvciBsaXN0c1xuICBpZiAoXy52YWx1ZXMoZXJyLmVycm9ycykubGVuZ3RoID09PSAxKSB7XG4gICAgZXJyLm1lc3NhZ2UgPSBfLnZhbHVlcyhlcnIuZXJyb3JzKVswXS5tZXNzYWdlO1xuICB9IGVsc2Uge1xuICAgIGNvbnN0IGVycm9ycyA9IF8ubWFwKF8udmFsdWVzKGVyci5lcnJvcnMpLCAnbWVzc2FnZScpO1xuICAgIGVyci5tZXNzYWdlID0gY3R4LmFwaVxuICAgICAgPyBlcnJvcnMuam9pbignLCAnKVxuICAgICAgOiBgPHVsIGNsYXNzPVwidGV4dC14cy1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbihcbiAgICAgICAgICAnPC9saT48bGk+J1xuICAgICAgICApfTwvbGk+PC91bD5gO1xuICB9XG5cbiAgcmV0dXJuIGVycjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBlcnJvckhhbmRsZXI7XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJlcnIiLCJfIiwiaXNFcnJvciIsIkVycm9yIiwidHlwZSIsImFjY2VwdHMiLCJkZWJ1ZyIsInN0YXR1cyIsIm1lc3NhZ2UiLCJCb29tIiwibm90QWNjZXB0YWJsZSIsIm91dHB1dCIsInBheWxvYWQiLCJwYXJzZVZhbGlkYXRpb25FcnJvciIsInZhbCIsInBhcnNlSW50IiwiaXNOdW1iZXIiLCJjcmVhdGUiLCJpc09iamVjdCIsInN0YXR1c0NvZGUiLCJoYXNGbGFzaCIsImlzRnVuY3Rpb24iLCJmbGFzaCIsImhhc1Nlc3Npb25zIiwic2Vzc2lvbiIsInNlc3Npb25TdG9yZSIsImlzU3RyaW5nIiwic2Vzc2lvbklkIiwic2V0IiwiaGFzUmVuZGVyIiwicmV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5tZXNzYWdlID0gY3R4LmFwaVxuICAgICAgPyBlcnJvcnMuam9pbignLCAnKVxuICAgICAgOiBgPHVsIGNsYXNzPVwidGV4dC14cy1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbihcbiAgICAgICAgICAnPC9saT48bGk+J1xuICAgICAgICApfTwvbGk+PC91bD5gO1xuICB9XG5cbiAgcmV0dXJuIGVycjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBlcnJvckhhbmRsZXI7XG4iXX0=
{
"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": "1.3.6",
"description": "A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)",
"version": "2.0.0",
"author": "Nick Baugh <niftylettuce@gmail.com>",
"bugs": "https://github.com/ladjs/koa-better-error-handler/issues",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"dependencies": {
"boom": "^5.1.0",
"boom": "5.1.0",
"co": "^4.6.0",
"debug": "^3.0.1",
"lodash": "^4.17.4",
"underscore.string": "^3.3.4"
"debug": "^4.1.1",
"lodash": "^4.17.11",
"underscore.string": "^3.3.5"
},
"devDependencies": {
"ava": "^0.24.0",
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"ava": "^1.4.0",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"codecov": "^3.0.0",
"cross-env": "^5.1.1",
"eslint": "^4.12.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.3.1",
"husky": "^0.14.3",
"koa": "^2.3.0",
"babel-preset-env": "^1.7.0",
"codecov": "^3.2.0",
"cross-env": "^5.2.0",
"eslint": "^5.15.3",
"eslint-config-xo-lass": "^1.0.3",
"fixpack": "^2.3.1",
"husky": "^1.3.1",
"koa": "^2.7.0",
"koa-404-handler": "^0.0.2",

@@ -30,19 +36,26 @@ "koa-basic-auth": "https://github.com/niftylettuce/basic-auth",

"koa-convert": "^1.2.0",
"koa-generic-session": "^2.0.0",
"koa-redis": "^3.0.0",
"koa-router": "^7.2.1",
"lint-staged": "^5.0.0",
"nyc": "^11.3.0",
"prettier": "^1.8.2",
"redis": "^2.7.1",
"remark-cli": "^4.0.0",
"remark-preset-github": "^0.0.7",
"supertest": "^3.0.0",
"xo": "^0.18.2"
"koa-generic-session": "^2.0.1",
"koa-redis": "^3.1.3",
"koa-router": "^7.4.0",
"lint-staged": "^8.1.5",
"nyc": "^13.3.0",
"redis": "^2.8.0",
"remark-cli": "^6.0.1",
"remark-preset-github": "^0.0.13",
"supertest": "^4.0.2",
"xo": "^0.24.0"
},
"engines": {
"node": ">= 6.4.0"
"node": ">=7.6.0"
},
"homepage": "https://github.com/ladjs/koa-better-error-handler",
"husky": {
"hooks": {
"pre-commit": "npm test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"keywords": [
"404",
"500",
"async",

@@ -52,8 +65,12 @@ "await",

"boom",
"context",
"ctx",
"custom",
"error",
"error-handler",
"errors",
"es7",
"flash",
"handler",
"handling",
"koa",

@@ -63,24 +80,35 @@ "messages",

"promises",
"stripe",
"404",
"500",
"ctx",
"context",
"errors",
"handling"
"stripe"
],
"license": "MIT",
"main": "lib/index.js",
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx,css,less,scss,json,graphql}": [
"prettier --write --single-quote --trailing-comma none",
"git add"
],
"*.md": ["remark . -qfo", "git add"]
"linters": {
"*.js": [
"xo --fix",
"git add"
],
"*.md": [
"remark . -qfo",
"git add"
],
"package.json": [
"fixpack",
"git add"
]
}
},
"main": "lib/index.js",
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": ["preset-github"]
"plugins": [
"preset-github"
]
},
"repository": "ladjs/koa-better-error-handler",
"scripts": {
"build": "node_modules/.bin/babel src --out-dir lib",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",

@@ -91,33 +119,11 @@ "lint": "xo && remark . -qfo",

"test-coverage": "cross-env NODE_ENV=test nyc ava",
"build": "node_modules/.bin/babel src --out-dir lib",
"watch": "node_modules/.bin/babel src --watch --out-dir lib"
},
"xo": {
"extends": "prettier",
"plugins": ["prettier"],
"parserOptions": {
"sourceType": "script"
},
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
}
],
"max-len": [
"error",
{
"code": 80,
"ignoreUrls": true
}
],
"capitalized-comments": "off",
"camelcase": "off",
"no-warning-comments": "off"
},
"space": true
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
}
}

@@ -63,2 +63,3 @@ # koa-better-error-handler

// override koa's undocumented error handler
// eslint-disable-next-line unicorn/prefer-add-event-listener
app.context.onerror = errorHandler;

@@ -131,2 +132,3 @@

// override koa's undocumented error handler
// eslint-disable-next-line unicorn/prefer-add-event-listener
app.context.onerror = errorHandler;

@@ -133,0 +135,0 @@

@@ -28,2 +28,3 @@ const http = require('http');

// override koa's undocumented error handler
// eslint-disable-next-line unicorn/prefer-add-event-listener
t.context.app.context.onerror = errorHandler;

@@ -30,0 +31,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