From 528aa2c1d0cc4f19e562196ec0a5d474e0f84923 Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Tue, 13 Feb 2024 22:33:03 +0000 Subject: [PATCH] Improve invalid rawsources seeds error messaging (#44) --- src/seeder.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/seeder.ts b/src/seeder.ts index f1e36d2..b37cad7 100644 --- a/src/seeder.ts +++ b/src/seeder.ts @@ -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); }