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(autoscaling): throw ValidationError instead of untyped Errors (#33388)
### 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(`datapointsToAlarm cannot be less than 1, got: ${props.datapointsToAlarm}`);
130
+
thrownewValidationError(`datapointsToAlarm cannot be less than 1, got: ${props.datapointsToAlarm}`,this);
131
131
}
132
132
if(!Token.isUnresolved(props.datapointsToAlarm)
133
133
&&!Token.isUnresolved(props.evaluationPeriods)
134
134
&&props.evaluationPeriods<props.datapointsToAlarm
135
135
){
136
-
thrownewError(`datapointsToAlarm must be less than or equal to evaluationPeriods, got datapointsToAlarm: ${props.datapointsToAlarm}, evaluationPeriods: ${props.evaluationPeriods}`);
136
+
thrownewValidationError(`datapointsToAlarm must be less than or equal to evaluationPeriods, got datapointsToAlarm: ${props.datapointsToAlarm}, evaluationPeriods: ${props.evaluationPeriods}`,this);
0 commit comments