If there is an error in the JS lambda, and we return, it returns to the scope one level up. Returning one level up does not return from the AWS lambda, and so the function continues even if an error has occurred. We want to return from the AWS lambda itself.
If there is an error in the JS lambda, and we return, it returns to the scope one level up. Returning one level up does not return from the AWS lambda, and so the function continues even if an error has occurred. We want to return from the AWS lambda itself.