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

feat(apigateway): multiple exceptions in exception_handler #1707

Merged

Conversation

sprkem
Copy link
Contributor

@sprkem sprkem commented Nov 10, 2022

Issue number: #1706

Summary

Changes

Adds support for handling multiple exceptions with one handler

User experience

Previously only the first exception decorator would work. Others would result in Internal Server Error response and a lambda error. With this change users can specify multiple errors in one decorator, or stack decorators on one function

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@sprkem sprkem requested a review from a team as a code owner November 10, 2022 12:13
@sprkem sprkem requested review from rubenfonseca and removed request for a team November 10, 2022 12:13
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation event_handlers tests labels Nov 10, 2022
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 10, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 10, 2022

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our AWS Lambda Powertools Discord: Invite link

@heitorlessa heitorlessa changed the title feat(exception_handler): adds support for multiple exceptions one one handler function feat(apigateway): support for multiple exceptions one one handler function Nov 14, 2022
@heitorlessa heitorlessa changed the title feat(apigateway): support for multiple exceptions one one handler function feat(apigateway): support for multiple exceptions in exception_handler Nov 14, 2022
@heitorlessa
Copy link
Contributor

Thanks a lot again @sprkem! Should be in this week's release by EOW

@heitorlessa heitorlessa changed the title feat(apigateway): support for multiple exceptions in exception_handler feat(apigateway): multiple exceptions in exception_handler Nov 14, 2022
@heitorlessa heitorlessa merged commit db4268b into aws-powertools:develop Nov 14, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 14, 2022

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

heitorlessa added a commit to ascopes/aws-lambda-powertools-python that referenced this pull request Nov 14, 2022
* develop: (155 commits)
  chore: apigw test event wrongly set with base64
  chore(deps-dev): bump types-requests from 2.28.11.3 to 2.28.11.4 (aws-powertools#1701)
  update changelog with latest changes
  feat(apigateway): multiple exceptions in exception_handler (aws-powertools#1707)
  chore(deps-dev): bump mypy-boto3-logs from 1.25.0 to 1.26.3 (aws-powertools#1702)
  update changelog with latest changes
  chore(ci): revert custom hw for E2E due to lack of hw
  update changelog with latest changes
  docs: project name consistency
  chore(ci): prevent dependabot updates to trigger E2E
  chore(ci): use new custom hw for E2E
  chore(ci): limit to src only to prevent dependabot failures
  update changelog with latest changes
  docs(examples): linting unnecessary whitespace
  chore(deps-dev): bump pytest-xdist from 2.5.0 to 3.0.2 (aws-powertools#1655)
  update changelog with latest changes
  docs(apigateway): add all resolvers in testing your code section for accuracy (aws-powertools#1688)
  chore(deps-dev): bump mkdocs-material from 8.5.7 to 8.5.9 (aws-powertools#1697)
  update changelog with latest changes
  docs(homepage): update default value for `POWERTOOLS_DEV` (aws-powertools#1695)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation event_handlers feature New feature or functionality size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: APIGatewayRestResolver exception_handler decorator is not stackable
2 participants