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(codepipeline): throw ValidationErrors instead of untyped Errors (#33855)
### Issue # (if applicable)
Relates to #32569
### Reason for this change
untyped Errors are not recommended
### Description of changes
ValidationErrors everywhere
### Describe any new or updated permissions being added
None
### Description of how you validated changes
Existing tests. Exemptions granted as this is 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("Exactly one of 'taskDefinitionTemplateInput' or 'taskDefinitionTemplateFile' can be provided in the ECS CodeDeploy Action");
218
+
thrownewUnscopedValidationError("Exactly one of 'taskDefinitionTemplateInput' or 'taskDefinitionTemplateFile' can be provided in the ECS CodeDeploy Action");
219
219
}
220
220
if(props.taskDefinitionTemplateFile){
221
221
returnprops.taskDefinitionTemplateFile.artifact;
222
222
}
223
223
if(props.taskDefinitionTemplateInput){
224
224
returnprops.taskDefinitionTemplateInput;
225
225
}
226
-
thrownewError("Specifying one of 'taskDefinitionTemplateInput' or 'taskDefinitionTemplateFile' is required for the ECS CodeDeploy Action");
226
+
thrownewUnscopedValidationError("Specifying one of 'taskDefinitionTemplateInput' or 'taskDefinitionTemplateFile' is required for the ECS CodeDeploy Action");
thrownewError(`The length of the outputVariables array must be between 1 and 15, got: ${props.outputVariables.length}`);
78
+
thrownewcdk.UnscopedValidationError(`The length of the outputVariables array must be between 1 and 15, got: ${props.outputVariables.length}`);
79
79
}
80
80
81
81
this.outputVariables=props.outputVariables||[];
@@ -89,7 +89,7 @@ export class CommandsAction extends Action {
89
89
*/
90
90
publicvariable(variableName: string): string{
91
91
if(!this.outputVariables.includes(variableName)){
92
-
thrownewError(`Variable '${variableName}' is not exported by \`outputVariables\`, exported variables: ${this.outputVariables.join(', ')}`);
92
+
thrownewcdk.UnscopedValidationError(`Variable '${variableName}' is not exported by \`outputVariables\`, exported variables: ${this.outputVariables.join(', ')}`);
// make sure the action was bound (= added to a pipeline)
400
400
if(this._actualNamespace===undefined){
401
-
thrownewError(`Cannot reference variables of action '${this.actionProperties.actionName}', `+
402
-
'as that action was never added to a pipeline');
401
+
thrownewUnscopedValidationError(`Cannot reference variables of action '${this.actionProperties.actionName}', as that action was never added to a pipeline`);
403
402
}else{
404
403
returnthis._customerProvidedNamespace!==undefined
405
404
// if a customer passed a namespace explicitly, always use that
0 commit comments