diff --git a/ecs_ecr.py b/ecs_ecr.py index b392f794a3e..1323bc6c35a 100644 --- a/ecs_ecr.py +++ b/ecs_ecr.py @@ -246,7 +246,7 @@ def get_repository_policy(self, registry_id, name): repositoryName=name, **build_kwargs(registry_id)) text = res.get('policyText') return text and json.loads(text) - except is_boto3_error_code('RepositoryPolicyNotFoundException'): + except is_boto3_error_code(['RepositoryNotFoundException', 'RepositoryPolicyNotFoundException']): return None def create_repository(self, registry_id, name, image_tag_mutability): @@ -334,7 +334,7 @@ def get_lifecycle_policy(self, registry_id, name): repositoryName=name, **build_kwargs(registry_id)) text = res.get('lifecyclePolicyText') return text and json.loads(text) - except is_boto3_error_code('LifecyclePolicyNotFoundException'): + except is_boto3_error_code(['LifecyclePolicyNotFoundException', 'RepositoryNotFoundException']): return None def put_lifecycle_policy(self, registry_id, name, policy_text):