1
votes

I am building an Android application whose back end is in python which runs as an AWS Lambda function. The invocation type is RequestResponse. Sometimes the app fails to invoke the Lambda function. What I can't figure out is how to get the specific error returned by the function in the response and log it. All I get is the type of error which is "Unhandled". Please help.

3
Failed to invoke or error on lambda code? You can check the cloud logs.notionquest
Cloudwatch is not saving any logs for some reason.JSmith
You are calling the Lambda function via the AWS SDK for Android? You aren't using API Gateway?Mark B
Yes with lambda InvokerFactory method.JSmith

3 Answers

1
votes

If the Monitoring tab in the AWS Lambda function does not show any executions, then it sounds like the invocation is failing or being denied.

You could look at the AWS CloudTrail logs to see how the request was received and handled.

If nothing is showing in CloudTrail, then your request never made it to AWS or was rejected before processing (eg out-of-date credentials?).

0
votes

Sounds like an escaping exception. Just make sure you catch it then present the details in your response payload.

We use this little tool to test our Python lambdas. It will help you figure out the exception. If you use it with the rest of the BST Tools you can expose the lambda even on the internet while running it locally in your IDE.

0
votes

I just had to add permissions for CloudWatch in Lambda and now it is logging.