From d4e5f1cdd1496893fc79ce7df6cecbdbde3005b5 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Tue, 26 Apr 2022 21:33:53 -0500 Subject: [PATCH] Throw for pool errors --- build-lists.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-lists.js b/build-lists.js index ab73015..ce01a4e 100644 --- a/build-lists.js +++ b/build-lists.js @@ -245,7 +245,7 @@ class BuildLists { const poolSize = 1000 - await PromisePool + const { errors } = await PromisePool .withConcurrency( poolSize ) .for( Array.from( this.lists[listOptions.name] ) ) .process(async ( listEntry, index, pool ) => { @@ -287,6 +287,11 @@ class BuildLists { // Write the endpoint to JSON await this.saveToJson( listEntry, endpointPath ) }) + + if ( errors.length !== 0 ) { + throw new Error( errors ) + } + } // Save app lists to JSON