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 6a16b74 commit 902c14b
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 902c14b

Please sign in to comment.