Skip to content

Return a HTTP error code instead of Internal Server Error #2

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
sebsto opened this issue Dec 14, 2023 · 1 comment
Closed

Return a HTTP error code instead of Internal Server Error #2

sebsto opened this issue Dec 14, 2023 · 1 comment

Comments

@sebsto
Copy link
Collaborator

sebsto commented Dec 14, 2023

Problem
When there is an error in the Lambda function, the API Gateway returns a generic error "Internal Server Error"

Root cause

The function handle(Event:Lambdacontext) here

func handle(_ request: Event, context: LambdaContext) async throws -> Output {

passes errors to the Lambda Runtime.

Possible solution

Manage errors in the handle(::) function and convert them in corresponding HTTP Error codes.

@sebsto
Copy link
Collaborator Author

sebsto commented Dec 14, 2023

Fix with 790e571

@sebsto sebsto closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant