E53F improv(event-handler): made error handler responses versatile by sdangol · Pull Request #4536 · aws-powertools/powertools-lambda-typescript · GitHub
[go: up one dir, main page]

Skip to content

Conversation

sdangol
Copy link
Contributor
@sdangol sdangol commented Sep 23, 2025 8000

Summary

This PR allows Error Handler responses to be more so that it allows full control over what's returned by the error handler and improves the user experience when using the API.

Changes

Please provide a summary of what's being changed

  • Changed the return type of error handlers to ErrorResponse | Response
  • statusCode omitted from ErrorResponse when using named error handler
  • Updated the ErrorResponse so that either error or message is required
  • Allow throwing of built in error classes from the error handler

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #4479


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.

@boring-cyborg boring-cyborg bot added event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Sep 23, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Sep 23, 2025
@sdangol sdangol self-assigned this Sep 23, 2025
@sdangol sdangol marked this pull request as ready for review September 23, 2025 13:18
@sdangol sdangol requested a review from svozza September 23, 2025 17:06
Copy link

@sdangol sdangol merged commit f08b366 into main Sep 23, 2025
38 checks passed
@sdangol sdangol deleted the improv/rest-error-handling branch September 23, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event-handler This item relates to the Event Handler Utility size/L PRs between 100-499 LOC tests PRs that add or change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: make error handlers' response more versatile

3 participants

0