middy-middleware-json-error-handler
Advanced tools
Comparing version 3.0.0 to 3.0.1
export declare function omit<T, K extends string>(names: readonly K[], obj: T): Omit<T, K>; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -1,5 +0,3 @@ | ||
/** @ignore */ | ||
/** An additional comment to make sure Typedoc attributes the comment above to the file itself */ | ||
import middleware from './JSONErrorHandlerMiddleware'; | ||
export default middleware; | ||
export * from './JSONErrorHandlerMiddleware'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
/** @ignore */ | ||
/* istanbul ignore file */ | ||
/** An additional comment to make sure Typedoc attributes the comment above to the file itself */ | ||
var JSONErrorHandlerMiddleware_1 = tslib_1.__importDefault(require("./JSONErrorHandlerMiddleware")); | ||
@@ -8,0 +6,0 @@ exports.default = JSONErrorHandlerMiddleware_1.default; |
@@ -0,0 +0,0 @@ export interface IErrorWithStatusCode { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { MiddlewareObj } from '@middy/core'; |
@@ -22,6 +22,6 @@ "use strict"; | ||
error = request.error; | ||
if (IErrorWithStatusCode_1.isErrorWithStatusCode(error) && error.statusCode < 500) { | ||
this.logger("Responding with full error as statusCode is " + error.statusCode); | ||
if ((0, IErrorWithStatusCode_1.isErrorWithStatusCode)(error) && error.statusCode < 500) { | ||
this.logger("Responding with full error as statusCode is ".concat(error.statusCode)); | ||
request.response = { | ||
body: JSON.stringify(omit_1.omit(['stack'], serialize_error_1.serializeError(error))), | ||
body: JSON.stringify((0, omit_1.omit)(['stack'], (0, serialize_error_1.serializeError)(error))), | ||
statusCode: error.statusCode | ||
@@ -42,3 +42,3 @@ }; | ||
}); }; | ||
this.logger = debug_1.default('middy-middleware-json-error-handler'); | ||
this.logger = (0, debug_1.default)('middy-middleware-json-error-handler'); | ||
this.logger('Setting up JSONErrorHandlerMiddleware'); | ||
@@ -45,0 +45,0 @@ } |
{ | ||
"name": "middy-middleware-json-error-handler", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A middy JSON error handler middleware.", | ||
@@ -15,3 +15,3 @@ "homepage": "", | ||
], | ||
"main": "lib/index.js", | ||
"main": "./lib/index.js", | ||
"keywords": [ | ||
@@ -30,3 +30,3 @@ "middy", | ||
"dependencies": { | ||
"debug": "^4.3.2", | ||
"debug": "^4.3.4", | ||
"serialize-error": "^8.1.0", | ||
@@ -56,44 +56,45 @@ "tslib": "^2.3.0" | ||
"devDependencies": { | ||
"@commitlint/cli": "^13.1.0", | ||
"@commitlint/config-conventional": "^13.1.0", | ||
"@commitlint/cli": "^17.6.3", | ||
"@commitlint/config-conventional": "^17.6.3", | ||
"@middy/core": "^2.4.3", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/commit-analyzer": "^8.0.1", | ||
"@semantic-release/git": "^9.0.0", | ||
"@semantic-release/npm": "^7.1.3", | ||
"@semantic-release/release-notes-generator": "^9.0.3", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/commit-analyzer": "^9.0.2", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/npm": "^9.0.0", | ||
"@semantic-release/release-notes-generator": "^10.0.3", | ||
"@types/aws-lambda": "^8.10.81", | ||
"@types/debug": "^4.1.7", | ||
"@types/http-errors": "^1.8.1", | ||
"@types/jest": "^26.0.24", | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^16.11.7", | ||
"@types/supertest": "^2.0.11", | ||
"aws-lambda": "*", | ||
"codecov": "^3.8.3", | ||
"concurrently": "^6.2.0", | ||
"concurrently": "^7.0.0", | ||
"cross-env": "^7.0.3", | ||
"http-errors": "^1.8.0", | ||
"husky": "^7.0.1", | ||
"http-errors": "^2.0.0", | ||
"husky": "^8.0.1", | ||
"jest": "^27.0.6", | ||
"jest-junit": "^12.2.0", | ||
"lint-staged": "^11.1.1", | ||
"pkg-ok": "^2.3.1", | ||
"jest-junit": "^14.0.0", | ||
"lint-staged": "^13.0.0", | ||
"pkg-ok": "^3.0.0", | ||
"prettier-standard": "^16.4.1", | ||
"rimraf": "^3.0.2", | ||
"semantic-release": "^17.4.4", | ||
"serverless": "^2.52.1", | ||
"serverless-offline": "^8.0.0", | ||
"serverless-webpack": "^5.5.1", | ||
"rimraf": "^5.0.0", | ||
"semantic-release": "^19.0.5", | ||
"serverless": "^3.4.0", | ||
"serverless-offline": "^8.5.0", | ||
"serverless-webpack": "^5.6.1", | ||
"source-map-support": "^0.5.19", | ||
"supertest": "^6.1.4", | ||
"ts-jest": "^27.0.4", | ||
"ts-loader": "^9.2.4", | ||
"ts-jest": "^27.1.3", | ||
"ts-loader": "^9.4.2", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-consistent-codestyle": "^1.16.0", | ||
"typedoc": "^0.21.5", | ||
"typescript": "^4.3.5", | ||
"wait-on": "^6.0.0", | ||
"webpack": "^5.47.1" | ||
"typedoc": "^0.24.7", | ||
"typescript": "^4.9.5", | ||
"wait-on": "^7.0.1", | ||
"webpack": "^5.82.1" | ||
}, | ||
"repository": "git@github.com:dbartholomae/middy-middleware-json-error-handler.git" | ||
} |
# middy-middleware-json-error-handler | ||
[![npm version](https://badge.fury.io/js/middy-middleware-json-error-handler.svg)](https://npmjs.org/package/middy-middleware-json-error-handler) [![downloads](https://img.shields.io/npm/dw/middy-middleware-json-error-handler.svg)](https://npmjs.org/package/middy-middleware-json-error-handler) [![open issues](https://img.shields.io/github/issues-raw/dbartholomae/middy-middleware-json-error-handler.svg)](https://github.com/dbartholomae/middy-middleware-json-error-handler/issues) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdbartholomae%2Fmiddy-middleware-json-error-handler.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdbartholomae%2Fmiddy-middleware-json-error-handler?ref=badge_shield) [![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme) [![build status](https://img.shields.io/circleci/project/github/dbartholomae/middy-middleware-json-error-handler/main.svg?style=flat)](https://circleci.com/gh/dbartholomae/workflows/middy-middleware-json-error-handler/tree/main) [![codecov](https://codecov.io/gh/dbartholomae/middy-middleware-json-error-handler/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/middy-middleware-json-error-handler) [![dependency status](https://david-dm.org/dbartholomae/middy-middleware-json-error-handler.svg?theme=shields.io)](https://david-dm.org/dbartholomae/middy-middleware-json-error-handler) [![devDependency status](https://david-dm.org/dbartholomae/middy-middleware-json-error-handler/dev-status.svg)](https://david-dm.org/dbartholomae/middy-middleware-json-error-handler?type=dev) [![semantic release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release#badge) [![Gitter](https://badges.gitter.im/dbartholomae/middy-middleware-json-error-handler.svg)](https://gitter.im/middy-middleware-json-error-handler) | ||
[![npm version](https://badge.fury.io/js/middy-middleware-json-error-handler.svg)](https://npmjs.org/package/middy-middleware-json-error-handler) | ||
[![downloads](https://img.shields.io/npm/dw/middy-middleware-json-error-handler.svg)](https://npmjs.org/package/middy-middleware-json-error-handler) | ||
[![open issues](https://img.shields.io/github/issues-raw/dbartholomae/middy-middleware-json-error-handler.svg)](https://github.com/dbartholomae/middy-middleware-json-error-handler/issues) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdbartholomae%2Fmiddy-middleware-json-error-handler.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdbartholomae%2Fmiddy-middleware-json-error-handler?ref=badge_shield) | ||
[![debug](https://img.shields.io/badge/debug-blue.svg)](https://github.com/visionmedia/debug#readme) | ||
[![build status](https://github.com/dbartholomae/middy-middleware-json-error-handler/workflows/Build%20and%20deploy/badge.svg?branch=main)](https://github.com/dbartholomae/middy-middleware-json-error-handler/actions?query=workflow%3A"Build+and+deploy") | ||
[![codecov](https://codecov.io/gh/dbartholomae/middy-middleware-json-error-handler/branch/main/graph/badge.svg)](https://codecov.io/gh/dbartholomae/middy-middleware-json-error-handler) | ||
[![semantic release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release#badge) | ||
A [middy](https://github.com/middyjs/middy) middleware that returns errors as http errors, compatible with [http-errors](https://www.npmjs.com/package/http-errors). | ||
@@ -40,3 +48,3 @@ | ||
export const handler = middy(helloWorld) | ||
.use(JSONErrorHandlerMiddleware()) // This middleware is needed do handle the errors thrown by the JWTAuthMiddleware | ||
.use(JSONErrorHandlerMiddleware()) // This middleware is needed do handle the errors thrown by the handler | ||
``` |
Sorry, the diff of this file is not supported yet
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
19272
16
50
41
116
Updateddebug@^4.3.4