Skip to content

Commit

Permalink
feat(ddb): more descriptive error when tableName is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhxNguyen7 committed Dec 6, 2024
1 parent 538515c commit 50b6ec0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/backend/src/db/ddb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class DDBClient<T extends Type<Record<string, unknown>>> {
documentClient: DynamoDBDocument;

constructor(tableName: string, schema: T) {
if (!tableName) {
throw new Error('DDBClient(): tableName must be defined');
}

this.tableName = tableName;
this.schema = schema;
this.client = new DynamoDB({
Expand Down

0 comments on commit 50b6ec0

Please sign in to comment.