Throw for pool errors

This commit is contained in:
Sam Carlton 2022-04-26 21:33:53 -05:00
parent 5779b12e6a
commit d4e5f1cdd1

View file

@ -245,7 +245,7 @@ class BuildLists {
const poolSize = 1000 const poolSize = 1000
await PromisePool const { errors } = await PromisePool
.withConcurrency( poolSize ) .withConcurrency( poolSize )
.for( Array.from( this.lists[listOptions.name] ) ) .for( Array.from( this.lists[listOptions.name] ) )
.process(async ( listEntry, index, pool ) => { .process(async ( listEntry, index, pool ) => {
@ -287,6 +287,11 @@ class BuildLists {
// Write the endpoint to JSON // Write the endpoint to JSON
await this.saveToJson( listEntry, endpointPath ) await this.saveToJson( listEntry, endpointPath )
}) })
if ( errors.length !== 0 ) {
throw new Error( errors )
}
} }
// Save app lists to JSON // Save app lists to JSON