I have a list of promises invoking other AWS Lambdas from inside an AWS Lambda:
promiseArray.push(lambda.invoke(params).promise())
In another function, I iterate over these promises and try resolve them:
for (let i = 0; i < promiseArray.length; i++) {
try {
let result = await promiseArray[i];
console.log("Success!");
} catch (e) {
console.log("Failed!");
}
}
Here's the issue I'm facing. Often times, the invoke throws a TimeoutError that doesn't get captured by the try-catch block and terminates Lambda execution by throwing an "Unhandled Promise Rejection" error. Note that this started appearing only after we upgraded from Node 8.10 to 12.x on the Lambda.