aws-cloudformation / aws-cloudformation-resource-providers-codeartifact

The CloudFormation Resource Provider Package for the AWS CodeArtifact service
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_CodeArtifact.html
Apache License 2.0
27 stars 7 forks source link

Changing exception type on deleting domain with repositories. #63

Closed jonjara closed 3 years ago

jonjara commented 3 years ago

Issue #, if available:

Description of changes: Apparently this exception would cause the handlers to continuously retry and would emit internal failure metrics even thought this is more of a user error. Changing this to throw CfnInvalidRequestException instead

Testing cfn submit and observed the new error message:

Domain must contain 0 repositories before deletion (Service: Codeartifact, Status Code: 409, Request ID: 2d4eee90-712e-4eb5-b6f9-928c7145431b, Extended Request ID: null)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.