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

Function URL support: invocation_response::failure always returns "Internal Server Error" #200

Open
instw opened this issue Jul 31, 2024 · 1 comment

Comments

@instw
Copy link

instw commented Jul 31, 2024

I'm using the C++ framework to create a lambda that's using a Lambda Function URL.
When there is an error (i.e. invocation_response::failure) , the HTTP response is always a "Internal Server Error".
This seems to be because the response needs to be in a format as detailed in https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html - which includes the "statusCode" etc.

Ideally, invocation_response::failure should at least set the "body" in the application/json response.

As a workaround, crafting the appropriate error payload using invocation_response::success works.

@marcomagdy
Copy link
Contributor

Also invocation_response has a public constructor which you can pass it a payload and whether a success or a failure response.

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

2 participants