diff --git a/targets/export-elasticsearch/src/ingester/common/fetchCdtnAdminDocuments.ts b/targets/export-elasticsearch/src/ingester/common/fetchCdtnAdminDocuments.ts index a288df008..5ac32f320 100644 --- a/targets/export-elasticsearch/src/ingester/common/fetchCdtnAdminDocuments.ts +++ b/targets/export-elasticsearch/src/ingester/common/fetchCdtnAdminDocuments.ts @@ -171,6 +171,13 @@ const createDocumentsFetcher = { source: string } >(graphQLAgreggateDocumentBySource, { source }) .toPromise(); + if (nbDocResult.error) { + throw new Error( + `Failed to count ${source} documents -> ${JSON.stringify( + nbDocResult.error + )}` + ); + } if (!nbDocResult.data) { return []; }