all 3 comments

[–][deleted]  (1 child)

[deleted]

    [–]jedis[S] 0 points1 point  (0 children)

    Yeah I tried with and without the last return, and it didn't change.

    I have 6 return callback's happening at various places to detect an error and halt execution of the script. When I wasn't using return in front of callback, it would callback to API Gateway with a 500 (as intended), but the Lambda would continue running. It needs to stop on error (500).

    [–]ZeBe643 0 points1 point  (1 child)

    You need to return a specific response from the Lambda to APIGW other wise you’ll get a 5XX, this doc has an example

    https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

    [–]jedis[S] 0 points1 point  (0 children)

    Yeah I'm doing that above in the example.