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(pipelines): throw ValidationError instead of untyped Errors (#33385)
### Issue
Relates to #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 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(`Deployment of stack ${artifact.stackName} requires assuming the role ${artifact.assumeRoleArn} with session tags, but assuming roles with session tags is not supported by CodePipeline.`);
66
+
thrownewValidationError(`Deployment of stack ${artifact.stackName} requires assuming the role ${artifact.assumeRoleArn} with session tags, but assuming roles with session tags is not supported by CodePipeline.`,stage);
thrownewError(`GitHub repository name should be a resolved string like '<owner>/<repo>', got '${repoString}'`);
260
+
thrownewUnscopedValidationError(`GitHub repository name should be a resolved string like '<owner>/<repo>', got '${repoString}'`);
261
261
}
262
262
this.owner=parts[0];
263
263
this.repo=parts[1];
@@ -425,7 +425,7 @@ class CodeStarConnectionSource extends CodePipelineSource {
425
425
super(repoString);
426
426
427
427
if(!this.isValidRepoString(repoString)){
428
-
thrownewError(`CodeStar repository name should be a resolved string like '<owner>/<repo>' or '<owner>/<group1>/<group2>/.../<repo>', got '${repoString}'`);
428
+
thrownewUnscopedValidationError(`CodeStar repository name should be a resolved string like '<owner>/<repo>' or '<owner>/<group1>/<group2>/.../<repo>', got '${repoString}'`);
thrownewError(`Top-level children must be graphs, got '${stageNode}'`);
518
+
thrownewValidationError(`Top-level children must be graphs, got '${stageNode}'`,this);
519
519
}
520
520
521
521
// Group our ordered tranches into blocks of 50.
@@ -610,7 +610,7 @@ export class CodePipeline extends PipelineBase {
610
610
case'group':
611
611
case'stack-group':
612
612
caseundefined:
613
-
thrownewError(`actionFromNode: did not expect to get group nodes: ${node.data?.type}`);
613
+
thrownewValidationError(`actionFromNode: did not expect to get group nodes: ${node.data?.type}`,this);
614
614
615
615
case'self-update':
616
616
returnthis.selfMutateAction();
@@ -630,7 +630,7 @@ export class CodePipeline extends PipelineBase {
630
630
returnthis.actionFromStep(node,node.data.step);
631
631
632
632
default:
633
-
thrownewError(`CodePipeline does not support graph nodes of type '${node.data?.type}'. You are probably using a feature this CDK Pipelines implementation does not support.`);
633
+
thrownewValidationError(`CodePipeline does not support graph nodes of type '${node.data?.type}'. You are probably using a feature this CDK Pipelines implementation does not support.`,this);
634
634
}
635
635
}
636
636
@@ -679,7 +679,7 @@ export class CodePipeline extends PipelineBase {
679
679
};
680
680
}
681
681
682
-
thrownewError(`Deployment step '${step}' is not supported for CodePipeline-backed pipelines`);
682
+
thrownewValidationError(`Deployment step '${step}' is not supported for CodePipeline-backed pipelines`,this);
0 commit comments