linuxdynasty / awsretry

Decorate your AWS Boto3 Calls with AWSRetry.backoff(). This will allows your calls to get around the AWS Eventual Consistency Errors.
45 stars 21 forks source link

Add Ability to exclude specific errors #14

Open barrycoleman opened 2 years ago

barrycoleman commented 2 years ago

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.