Skip to content

Commit

Permalink
change error verbiage
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Nov 6, 2023
1 parent 8226922 commit 25abe43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-glue-alpha/lib/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ export class Database extends Resource implements IDatabase {

function validateLocationUri(locationUri: string): void {
if (locationUri.length < 1 || locationUri.length > 1024) {
throw new Error(`locationUri length must be (inclusively) between 1 and 1024, but was ${locationUri.length}`);
throw new Error(`locationUri length must be (inclusively) between 1 and 1024, got ${locationUri.length}`);
}
}

function validateDescription(description: string): void {
if (description.length > 2048) {
throw new Error(`description length must be less than or equal to 2048, but was ${description.length}`);
throw new Error(`description length must be less than or equal to 2048, got ${description.length}`);
}
}
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-glue-alpha/test/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ test('locationUri length must be <= 1024', () => {
new glue.Database(stack, 'Database', {
locationUri: 'a'.repeat(1025),
}),
).toThrow();
).toThrow('locationUri length must be (inclusively) between 1 and 1024, got 1025');
});

test('description length must be <= 2048', () => {
expect(() =>
new glue.Database(stack, 'Database', {
description: 'a'.repeat(2049),
}),
).toThrow();
).toThrow('description length must be less than or equal to 2048, got 2049');
});

test('can specify a physical name', () => {
Expand Down

0 comments on commit 25abe43

Please sign in to comment.