2.1.1 • Published 3 years ago

@keboola/serverless-default-error-responses v2.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

serverless-default-error-responses

serverless

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", 
  "errorCode": 500, 
  "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 --dev
  2. Add plugin to your serverless.yml:
plugins:
- '@keboola/serverless-default-error-responses'
2.1.1

3 years ago

2.1.0

3 years ago

1.0.0

6 years ago