Skip to content

Commit

Permalink
Improve invalid rawsources seeds error messaging (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
domdomegg authored Feb 13, 2024
1 parent a207e9a commit 528aa2c
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 528aa2c

Please sign in to comment.