Serverless Lambda Error
Normally, throwing unhandled new Error
inside AWS Lambda environment tied to API Gateway results in 500 - Internal Server Error
.
This module solves that problem by wrapping your Error
into API Gateway compatible response format.
Installation
npm install serverless-lambda-throw --save
Usage
const LambdaError = ; moduleexports { ; // registers error handler throw 'Uncaught error thrown!'; // Responds with 400 and wrapped error into API Gateway compatible format};