Emulate AWS λ and API Gateway locally when developing your Serverless project
## Description In this scenario, we are expecting a body key in the result object, but what if the result doesn't have a body key or if the result is a simple boolean? I actually, encountered a situation where a Lambda function was returning a bool, which caused the Lambda function to crash, leading to timeouts. To address this, I added exception handling. If the result object contains a body key, it will function as expected. However, if the body key is absent, the Lambda function won't crash, preventing timeouts. ## Motivation and Context This will resolve the issue where, if the result object doesn't have a body key, or if the result is a string or boolean, it won't crash. The exception will be handled smoothly. ## How Has This Been Tested? I have added this change to the invoke.py and then ran the same lambda function, which resolved the issue and I was able to run the lambda functions. ## Screenshots (if appropriate): <img width="454" alt="Screenshot 2024-08-27 at 1 50 44 AM" src="https://github.com/user-attachments/assets/b0aa2c39-16b2-47a3-90e4-02f91d7714a7">
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by haider-zada and has received 5 comments.