From 6816de4a8e592713e609d99aae3fa2b32cdee01e Mon Sep 17 00:00:00 2001 From: Martial Maillot Date: Tue, 2 Apr 2024 16:16:00 +0200 Subject: [PATCH] =?UTF-8?q?feat(export):=20ajout=20de=20contexte=20sur=20l?= =?UTF-8?q?'erreur=20quand=20on=20r=C3=A9cup=C3=A8re=20les=20documents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ingester/common/fetchCdtnAdminDocuments.ts | 7 +++++++ 1 file changed, 7 insertions(+) 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 []; }