Skip to content

feat(event_handler): add extras HTTP Error Code Exceptions #6454

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

Merged
merged 7 commits into from
Apr 15, 2025

Conversation

kazu728
Copy link
Contributor

@kazu728 kazu728 commented Apr 13, 2025

Issue number: #6379

Summary

Currently, the Event Handler REST API provides pre-defined errors for HTTP 400, 401, 404, 500. This PR adds 4 more, based on the API calls CommomErrors, meaning adding 403, 413, 408 e 503.

Changes

The user can easily throw ForbiddenError (403), RequestTimeoutError (408), RequestEntityTooLargeError (413) and ServiceUnavailableError (503).

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.

@kazu728 kazu728 requested a review from a team as a code owner April 13, 2025 13:37
@kazu728 kazu728 requested a review from anafalcao April 13, 2025 13:37
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 13, 2025
Copy link

boring-cyborg bot commented Apr 13, 2025

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 Powertools for AWS Lambda Discord: Invite link

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.32%. Comparing base (7de9cbd) to head (c85fb1a).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6454   +/-   ##
========================================
  Coverage    96.32%   96.32%           
========================================
  Files          243      243           
  Lines        11812    11824   +12     
  Branches       881      881           
========================================
+ Hits         11378    11390   +12     
  Misses         338      338           
  Partials        96       96           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anafalcao
Copy link
Contributor

Hello @kazu728! Thank you for the PR, I'll review it and get back to you.

@anafalcao anafalcao changed the title feat(event_handler): add error status feat(event_handler): add HTTP Error Code Exceptions Apr 14, 2025
@anafalcao anafalcao linked an issue Apr 14, 2025 that may be closed by this pull request
2 tasks
@leandrodamascena leandrodamascena changed the title feat(event_handler): add HTTP Error Code Exceptions feat(event_handler): add extras HTTP Error Code Exceptions Apr 14, 2025
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Apr 14, 2025
@github-actions github-actions bot added feature New feature or functionality and removed documentation Improvements or additions to documentation labels Apr 14, 2025
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Thanks for sending this PR @kazu728! And thanks for fixing small things @anafalcao!

APPROVED!

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Apr 15, 2025
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Apr 15, 2025
@leandrodamascena leandrodamascena self-requested a review April 15, 2025 16:17
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Apr 15, 2025
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Apr 15, 2025
Copy link
Contributor

@anafalcao anafalcao left a comment

Choose a reason for hiding this comment

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

Approved!! Thank you again for the work here

@leandrodamascena leandrodamascena merged commit 7482311 into aws-powertools:develop Apr 15, 2025
12 checks passed
Copy link

boring-cyborg bot commented Apr 15, 2025

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

leandrodamascena added a commit that referenced this pull request Apr 24, 2025
* feat(event_handler): add error status

* update doc with new errors

* fix typo

* change class description

---------

Co-authored-by: Ana Falcão <[email protected]>
Co-authored-by: Ana Falcao <[email protected]>
Co-authored-by: Leandro Damascena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers feature New feature or functionality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Additional HTTP Error Code Exceptions
3 participants