Skip to content

Commit d2b1e7c

Browse files
authored
Merge pull request #115 from tharropoulos/err-import
fix(backfill): correct variable name in error handler
2 parents 83564a2 + ad8cb93 commit d2b1e7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

functions/src/backfill.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ module.exports = onDocumentWritten("typesense_sync/backfill", async (snapshot, c
9292
try {
9393
await typesense.collections(encodeURIComponent(config.typesenseCollectionName)).documents().import(currentDocumentsBatch, {action: "upsert"});
9494
info(`Imported ${currentDocumentsBatch.length} documents into Typesense`);
95-
} catch (error) {
96-
error(`Import error in a batch of documents from ${currentDocumentsBatch[0].id} to ${lastDoc.id}`, error);
97-
if ("importResults" in error) {
98-
logImportErrors(error.importResults);
95+
} catch (err) {
96+
error(`Import error in a batch of documents from ${currentDocumentsBatch[0].id} to ${lastDoc.id}`, err);
97+
if ("importResults" in err) {
98+
logImportErrors(err.importResults);
9999
}
100100
}
101101

0 commit comments

Comments
 (0)