Skip to content

Commit 181aa3a

Browse files
authored
chore: update error message to include key name for metric (#34221)
### Issue # (if applicable) Closes #34156 ### Reason for this change Updating the message to provide better message ### Description of changes Simple change on the message to include key name ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Local build has been successful ### Checklist - [ ] 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*
1 parent adfa416 commit 181aa3a

File tree

1 file changed

+1
-1
lines changed
  • packages/aws-cdk-lib/aws-cloudwatch/lib

1 file changed

+1
-1
lines changed

packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ export class Metric implements IMetric {
591591

592592
dimsArray.map(key => {
593593
if (dims[key] === undefined || dims[key] === null) {
594-
throw new cdk.UnscopedValidationError(`Dimension value of '${dims[key]}' is invalid`);
594+
throw new cdk.UnscopedValidationError(`Dimension value of '${dims[key]}' is invalid for key: ${key}`);
595595
}
596596
if (key.length < 1 || key.length > 255) {
597597
throw new cdk.UnscopedValidationError(`Dimension name must be at least 1 and no more than 255 characters; received ${key}`);

0 commit comments

Comments
 (0)