Fix error message in bulk delete to reflect total document count (#2331)

* Fix error message in bulk delete to reflect total document count

* Fix format
This commit is contained in:
Laurent Nguyen
2026-01-23 07:38:04 +01:00
committed by GitHub
parent f83a2c4442
commit 703218debf
+3 -6
View File
@@ -44,7 +44,8 @@ export const deleteDocuments = async (
documentIds: DocumentId[], documentIds: DocumentId[],
abortSignal: AbortSignal, abortSignal: AbortSignal,
): Promise<IBulkDeleteResult[]> => { ): Promise<IBulkDeleteResult[]> => {
const clearMessage = logConsoleProgress(`Deleting ${documentIds.length} ${getEntityName(true)}`); const totalCount = documentIds.length;
const clearMessage = logConsoleProgress(`Deleting ${totalCount} ${getEntityName(true)}`);
try { try {
const v2Container = await client().database(collection.databaseId).container(collection.id()); const v2Container = await client().database(collection.databaseId).container(collection.id());
@@ -83,11 +84,7 @@ export const deleteDocuments = async (
const flatAllResult = Array.prototype.concat.apply([], allResult); const flatAllResult = Array.prototype.concat.apply([], allResult);
return flatAllResult; return flatAllResult;
} catch (error) { } catch (error) {
handleError( handleError(error, "DeleteDocuments", `Error while deleting ${totalCount} ${getEntityName(totalCount > 1)}`);
error,
"DeleteDocuments",
`Error while deleting ${documentIds.length} ${getEntityName(documentIds.length > 1)}`,
);
throw error; throw error;
} finally { } finally {
clearMessage(); clearMessage();