Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix region error handling in Lambda@Edge implementation #6886

Merged
merged 1 commit into from Oct 25, 2019

Conversation

pmuens
Copy link
Contributor

@pmuens pmuens commented Oct 25, 2019

What did you implement

Fixes a problem where the ServerlessError class was not used correctly. Also added the unit tests which checks if the region is validated.

How can we verify it

Run serverless package with the following serverless.yml. You shouldn't see an error due to a ServerlessError misuse (but you should see the error that the region is incorrect).

service: test-${self:custom.idx}

provider:
  name: aws
  runtime: nodejs10.x
  versionFunctions: false
  region: eu-central-1
  stage: dev

custom:
  idx: 0

functions:
  hello:
    handler: functions/handler.handler
    events:
      - cloudFront:
          eventType: viewer-response
          origin: https://serverless.com/framework/docs

Todos

Useful Scripts
  • npm run test-ci --> Run all validation checks on proposed changes
  • npm run lint-updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check-updated --> Check if updated files adhere to Prettier config
  • npm run prettify-updated --> Prettify all the updated files
  • Write and run all tests
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@pmuens pmuens added this to the 1.56.0 milestone Oct 25, 2019
@pmuens pmuens force-pushed the lambda-at-edge-validation-error branch from 83db633 to 5313b2a Compare October 25, 2019 11:47
@pmuens pmuens requested a review from medikoo October 25, 2019 11:50
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pmuens
Copy link
Contributor Author

pmuens commented Oct 25, 2019

@medikoo Thanks! 💪

@pmuens pmuens merged commit 1b494b8 into master Oct 25, 2019
@pmuens pmuens deleted the lambda-at-edge-validation-error branch October 25, 2019 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants