Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect exit code when the HTTP response is failure #208

Closed
jackie-linz opened this issue Aug 26, 2024 · 0 comments · Fixed by #209
Closed

Incorrect exit code when the HTTP response is failure #208

jackie-linz opened this issue Aug 26, 2024 · 0 comments · Fixed by #209

Comments

@jackie-linz
Copy link
Contributor

I have a lambda function with function URL that returns status code of 400

export const handler = async (event) => {
  return  {
    statusCode: 400,
    body: JSON.stringify({data: 'Hello from Lambda!'}),
  };
};

I call this function with awscurl and I'd expect that the command exit with non-zero exit code, but got zero instead.

$ awscurl --service lambda https://<my-function-url>.lambda-url.ap-southeast-2.on.aws/
{"data":"Hello from Lambda!"}
$ echo $?
0

Looks like this line of code is missing a return?

https://github.com/okigan/awscurl/blob/master/awscurl/awscurl.py#L573

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant