diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index 38ff81fb2..8d11a5832 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -472,7 +472,7 @@ class LambdaFunction(BaseModel): payload["result"] = response_headers["x-amz-log-result"] result = res.encode("utf-8") else: - result = json.dumps(payload) + result = res if errored: response_headers["x-amz-function-error"] = "Handled"