-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(custom-resources): rename catchErrorPattern
to ignoreErrorCodesMatching
#6553
feat(custom-resources): rename catchErrorPattern
to ignoreErrorCodesMatching
#6553
Conversation
…ng with ignoreErrorCodesMatching
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Outdated
Show resolved
Hide resolved
@@ -190,9 +190,21 @@ export interface AwsCustomResourceProps { | |||
* | |||
*/ | |||
export class AwsCustomResource extends cdk.Construct implements iam.IGrantable { | |||
|
|||
private static breakIgnoreErrorsCircuit(sdkCalls: Array<AwsSdkCall | undefined>, caller: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personal taste... why not a non exported function outside the class for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just prefer starting with the minimal visibility necessary. The function is used to validate specific configuration that can (currently) only arise in the AwsCustomResource
class. I'd like additional usages of it to be very intentional and not just treat it as a sort of utility function.
packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…esMatching` (#6553) In the spirit of being "Explicit and Clear*, renaming `catchErrorPattern` to `ignoreErrorCodesMatching` since it better describes the meaning of this property. In addition, the following validations were added: - `ignoreErrorCodesMatching` cannot be used with `PhysicalResourceId.fromResponse` since the response might not exist. - `ignoreErrorCodesMatching` cannot be used with `getData` or `getDataString` since the resource might not have any attributes due to the error catching. Relates to #5873 BREAKING CHANGE: `catchErrorPattern` was renamed to `ignoreErrorCodesMatching`. In addition, a few synth time validations were added when using this property. See [Error Handling](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#error-handling-1) for details.
…esMatching` (aws#6553) In the spirit of being "Explicit and Clear*, renaming `catchErrorPattern` to `ignoreErrorCodesMatching` since it better describes the meaning of this property. In addition, the following validations were added: - `ignoreErrorCodesMatching` cannot be used with `PhysicalResourceId.fromResponse` since the response might not exist. - `ignoreErrorCodesMatching` cannot be used with `getData` or `getDataString` since the resource might not have any attributes due to the error catching. Relates to aws#5873 BREAKING CHANGE: `catchErrorPattern` was renamed to `ignoreErrorCodesMatching`. In addition, a few synth time validations were added when using this property. See [Error Handling](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#error-handling-1) for details.
Description
Notice that i've added the
ignoreErrorCodesMatching
andPhysicalResourceId.fromResponse
validation even on theonDelete
. This is because it might result in an empty physical resource id, which will in turn cause a failure when submitting the response to CloudFormation:Commit Message
feat(custom-resources): rename
catchErrorPattern
toignoreErrorCodesMatching
(#6553)In the spirit of being "Explicit and Clear*, renaming
catchErrorPattern
toignoreErrorCodesMatching
since it better describes the meaning of this property.In addition, the following validations were added:
ignoreErrorCodesMatching
cannot be used withPhysicalResourceId.fromResponse
since the response might not exist.ignoreErrorCodesMatching
cannot be used withgetData
orgetDataString
since the resource might not have any attributes due to the error catching.Relates to #5873
BREAKING CHANGE:
catchErrorPattern
was renamed toignoreErrorCodesMatching
. In addition, a few synth time validations were added when using this property. See Error Handling for details.End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license