@keboola/serverless-default-error-responses

Serverless plugin that adds unified API Gateway responses for error states

Stats

StarsIssuesVersionUpdatedCreatedSize
@keboola/serverless-default-error-responses
301.0.04 years ago4 years agoMinified + gzip package size for @keboola/serverless-default-error-responses in KB

Readme

serverless-default-error-responses

serverless Build Status

Serverless plugin that adds unified API Gateway responses for error states. It adds CORS headers to all 4xx and 5xx API responses and formats output for users like this:

{
  "errorMessage": "Application Error", 
  "errorType": "ApplicationError", 
  "apiRequestId": "2e2819fa-c93c-11e7-a46f-91ce8f8df51e"
}

It hides real error reason in case of 5xx errors and replaces it for Application Error. It also adds API Gateway request id for potential further investigation in CloudWatch logs.

Installation

  1. Install npm package: yarn add @keboola/serverless-default-error-responses
  2. Add plugin to your serverless.yml: ```yaml plugins:
  • '@keboola/serverless-default-error-responses' ```

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.