In AWS Lambda, I can see errors in the cloud watch metrics sometimes, but when I check the logs for the logs, I don't see any error. Does the AWS Lambda don't log the errors automatically?
Make sure your Lambda function's execute role has the permissions logs:CreateLogGroup, logs:CreateLogStream and logs:PutLogEvents. A good way to do this is to grant the built-in policy AWSLambdaBasicExecutionRole to your Lambda function's execution role.