Skip to content

Commit

Permalink
change error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Sep 13, 2023
1 parent 4cb8339 commit 72706d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class GaugeWidget extends ConcreteWidget {
this.copyMetricWarnings(...this.metrics);

if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
throw new Error('You must also specify a start if you specify an end');
}
}

Expand Down Expand Up @@ -436,7 +436,7 @@ export class GraphWidget extends ConcreteWidget {
this.copyMetricWarnings(...this.leftMetrics, ...this.rightMetrics);

if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
throw new Error('You must also specify a start if you specify an end');
}
}

Expand Down Expand Up @@ -574,7 +574,7 @@ export class SingleValueWidget extends ConcreteWidget {
}

if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
throw new Error('You must also specify a start if you specify an end');
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-cloudwatch/test/graphs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ describe('Graphs', () => {
view: GraphWidgetView.PIE,
end: '2018-12-17T06:00:00.000Z',
});
}).toThrow(/You must specify a start if you specify an end/);
}).toThrow(/You must also specify a start if you specify an end/);
});

test('cannot specify an end without a start in SingleValueWidget', () => {
Expand All @@ -966,7 +966,7 @@ describe('Graphs', () => {
metrics: [new Metric({ namespace: 'CDK', metricName: 'Test' })],
end: '2018-12-17T06:00:00.000Z',
});
}).toThrow(/You must specify a start if you specify an end/);
}).toThrow(/You must also specify a start if you specify an end/);
});

test('cannot specify an end without a start in GaugeWidget', () => {
Expand All @@ -979,6 +979,6 @@ describe('Graphs', () => {
metrics: [new Metric({ namespace: 'CDK', metricName: 'Test' })],
end: '2018-12-17T06:00:00.000Z',
});
}).toThrow(/You must specify a start if you specify an end/);
}).toThrow(/You must also specify a start if you specify an end/);
});
});

0 comments on commit 72706d0

Please sign in to comment.