Skip to content

Commit

Permalink
Improve invalid rawsources seeds error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
domdomegg committed Feb 13, 2024
1 parent 0e541e9 commit 77ad39d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/seeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function writeSeedBatch(dynamodbWriteFunction: DynamoDBWriteFunction, tableName:
if (err) {
if (err instanceof Error && 'code' in err && err.code === 'ResourceNotFoundException' && interval <= 5000) {
execute(interval + 1000);
} else if (err instanceof TypeError && err.message === "Cannot read properties of undefined (reading '0')") {
reject(new Error(`Failed to seed items for the ${tableName} table because of an AWS library error. This usually means your \`rawsources\` seed files are invalid.`, { cause: err }));
} else {
reject(err);
}
Expand Down

0 comments on commit 77ad39d

Please sign in to comment.