This will throw a ResourceNotFoundException, which is actually ok.
However, AWSRetry will catch this and retry the call due the match on "^.*NotFound".
A possible fix is the change the regex for not found to "^.*NotFound$", so the error has to end in NotFound, but I suspect that adding an optional exclude list might be better.
Would be great to be able to exclude specific errors.
For instance,
aws_lambda = boto3.client('lambda'); policy = aws_lambda.get_policy(FunctionName='TestFunction')
This will throw a ResourceNotFoundException, which is actually ok. However, AWSRetry will catch this and retry the call due the match on "^.*NotFound".
A possible fix is the change the regex for not found to "^.*NotFound$", so the error has to end in NotFound, but I suspect that adding an optional exclude list might be better.