You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(s3): throw ValidationError instead of untyped errors (#33109)
### Issue
`aws-s3*` for #32569
### Description of changes
ValidationErrors everywhere
### Describe any new or updated permissions being added
n/a
### Description of how you validated changes
Existing tests. Exemptions granted as this is basically a refactor of existing code.
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
thrownewError('The BucketDeployment construct requires that the "destinationKeyPrefix" be <=104 characters.');
459
+
thrownewValidationError('The BucketDeployment construct requires that the "destinationKeyPrefix" be <=104 characters.',this);
459
460
}
460
461
461
462
/*
@@ -567,7 +568,7 @@ export class BucketDeployment extends Construct {
567
568
// configurations since we have a singleton.
568
569
if(memoryLimit){
569
570
if(cdk.Token.isUnresolved(memoryLimit)){
570
-
thrownewError("Can't use tokens when specifying 'memoryLimit' since we use it to identify the singleton custom resource handler.");
571
+
thrownewValidationError("Can't use tokens when specifying 'memoryLimit' since we use it to identify the singleton custom resource handler.",this);
571
572
}
572
573
573
574
uuid+=`-${memoryLimit.toString()}MiB`;
@@ -578,7 +579,7 @@ export class BucketDeployment extends Construct {
578
579
// configurations since we have a singleton.
579
580
if(ephemeralStorageSize){
580
581
if(ephemeralStorageSize.isUnresolved()){
581
-
thrownewError("Can't use tokens when specifying 'ephemeralStorageSize' since we use it to identify the singleton custom resource handler.");
582
+
thrownewValidationError("Can't use tokens when specifying 'ephemeralStorageSize' since we use it to identify the singleton custom resource handler.",this);
conststringifiedAcceptedCfnFns=acceptedCfnFns.map((fn)=>`"${fn}"`).join(' or ');
66
-
thrownewError(`Invalid CloudFormation reference. Key must start with any of ${stringifiedAcceptedCfnFns}. Got ${JSON.stringify(part)}`);
67
+
thrownewValidationError(`Invalid CloudFormation reference. Key must start with any of ${stringifiedAcceptedCfnFns}. Got ${JSON.stringify(part)}`,scope);
0 commit comments