awslabs / aws-lambda-powershell-runtime

This new PowerShell custom runtime for AWS Lambda makes it even easier to run Lambda functions written in PowerShell to process events.
Apache License 2.0
57 stars 17 forks source link

AWS Lambda throw error does not send to dead letter queue #21

Closed EarlM1 closed 1 year ago

EarlM1 commented 1 year ago

The throw error command messages stops the function and writes the error to the cloudwatch log but will not send to configured dead letter queue.

On the contrary, if you use the start-sleep command to make the function timeout, the event will be sent to the dead letter queue.

I used the throw error commands listed in the below article which was referenced in this github readme. https://docs.aws.amazon.com/lambda/latest/dg/powershell-exceptions.html

julianwood commented 1 year ago

Is this a synchronous or asynchronous invoke? Only asynchronous invokes go to a DLQ if there's an error: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html

EarlM1 commented 1 year ago

This was an asynchronous invoke. The lambda does go to the DLQ when the error is caused by lambda timeout, but not if I use powershell to throw the error.

EarlM1 commented 1 year ago

The issue only occurs when the throw command is within the foreach parallel loop