-
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(cloudwatch): throw ValidationErrors
instead of untyped Errors
#33456
Conversation
@@ -485,7 +485,7 @@ export class Metric implements IMetric { | |||
public toAlarmConfig(): MetricAlarmConfig { | |||
const metricConfig = this.toMetricConfig(); | |||
if (metricConfig.metricStat === undefined) { | |||
throw new Error('Using a math expression is not supported here. Pass a \'Metric\' object instead'); | |||
throw new cdk.UnscopedValidationError('Using a math expression is not supported here. Pass a \'Metric\' object instead'); |
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.
these are all unscoped because Metric
isn't a Construct. We'd have to send in scope: Construct
as a property to all metrics everywhere to get this to be scoped
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.
(This review is outdated)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33456 +/- ##
=======================================
Coverage 81.00% 81.00%
=======================================
Files 238 238
Lines 14271 14271
Branches 2492 2492
=======================================
Hits 11560 11560
Misses 2425 2425
Partials 286 286
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This pull request has been removed from the queue for the following reason: The pull request can't be updated You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue
Relates to #32569
Description of changes
ValidationErrors
everywhereDescribe 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
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license