Skip to content

Feature request: Additional HTTP Error Code Exceptions #6379

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

Closed
2 tasks done
kazu728 opened this issue Apr 1, 2025 · 7 comments · Fixed by #6454
Closed
2 tasks done

Feature request: Additional HTTP Error Code Exceptions #6379

kazu728 opened this issue Apr 1, 2025 · 7 comments · Fixed by #6454
Assignees
Labels

Comments

@kazu728
Copy link
Contributor

kazu728 commented Apr 1, 2025

Use case

ref: https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/event_handler/exceptions.py

I need to handle additional HTTP error codes, specifically 413 (Payload Too Large). I notice that the current exceptions.py only implements a subset of HTTP error codes (400, 401, 404, 500).
While I understand I can extend ServiceError to create my own custom exceptions, this creates inconsistency in my codebase where some errors come from PowerTools and others from my custom definitions.

Are there plans to expand the list of predefined exceptions to cover more HTTP status codes?
What is the rationale behind which HTTP errors are currently implemented vs. those that aren't?

Solution/User Experience

Add status code

Alternative solutions

Acknowledgment

@kazu728 kazu728 added feature-request feature request triage Pending triage from maintainers labels Apr 1, 2025
Copy link

boring-cyborg bot commented Apr 1, 2025

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@anafalcao
Copy link
Contributor

Hello @kazu728 !
Thank you for opening this issue. You raise a valid point about the current subset of implemented HTTP status codes. The initial selection of HTTP error codes was based on project decisions made at that time, but I believe would be beneficial to incorporate 413. We could add the API calls CommomErrors, meaning adding 403, 413, 408 e 503. Do you suggest others?

Would you like to submit a PR with these changes?

@anafalcao anafalcao moved this from Triage to Pending customer in Powertools for AWS Lambda (Python) Apr 1, 2025
@anafalcao anafalcao added need-customer-feedback Requires more customers feedback before making or revisiting a decision event_handlers and removed triage Pending triage from maintainers labels Apr 1, 2025
@kazu728
Copy link
Contributor Author

kazu728 commented Apr 5, 2025

Thank you for deaIing with this issue. I do not suggest any other changes.

Would you like to submit a PR with these changes?

Yes, I will submit it.

@leandrodamascena leandrodamascena moved this from Pending customer to Working on it in Powertools for AWS Lambda (Python) Apr 5, 2025
@leandrodamascena leandrodamascena moved this from Working on it to Backlog in Powertools for AWS Lambda (Python) Apr 10, 2025
@leandrodamascena
Copy link
Contributor

Hi @kazu728! Please let me know if you have time to submit a PR in the next 2 weeks. I'm not pushing, but since we are planing the release, we'd like to add this.

I totally understand if you can't, we're all busy.

@leandrodamascena leandrodamascena removed the need-customer-feedback Requires more customers feedback before making or revisiting a decision label Apr 10, 2025
@kazu728
Copy link
Contributor Author

kazu728 commented Apr 11, 2025

Sorry, I will deal with this issue by the weekend.

@leandrodamascena
Copy link
Contributor

Hey @kazu728! Thanks a lot.

Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Coming soon
Development

Successfully merging a pull request may close this issue.

3 participants