Skip to content
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

chore(certificatemanager): improve logging for cert creation #30525

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class Certificate extends CertificateBase implements ICertificate {

// check if domain name is 64 characters or less
if (!Token.isUnresolved(props.domainName) && props.domainName.length > 64) {
throw new Error('Domain name must be 64 characters or less');
throw new Error(`Domain name must be 64 characters or less, got ${props.domainName.length}: ${props.domainName}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wording is a bit too casual. Could you wordsmith this a bit?

}

const allDomainNames = [props.domainName].concat(props.subjectAlternativeNames || []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test('throws when domain name is longer than 64 characters', () => {
new Certificate(stack, 'Certificate', {
domainName: 'example.com'.repeat(7),
});
}).toThrow(/Domain name must be 64 characters or less/);
}).toThrow(/Domain name must be 64 characters or less, got 77: example.comexample.comexample.comexample.comexample.comexample.comexample.com/);
});

test('does not throw when domain name is longer than 64 characters with tokens', () => {
Expand Down
Loading