Skip to content

Commit

Permalink
chore(certificatemanager): improve logging for cert creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alngy committed Jun 11, 2024
1 parent db3e77d commit 0fb3b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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}`);
}

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

0 comments on commit 0fb3b6c

Please sign in to comment.