fix(medusa): Batch job not saving the errors properly (#2812)

This commit is contained in:
Adrien de Peretti
2022-12-16 20:13:53 +01:00
committed by GitHub
parent c16522d6ce
commit 5e4decbc1c
6 changed files with 54 additions and 54 deletions
@@ -69,6 +69,7 @@ export abstract class AbstractBatchJobStrategy
err: unknown,
result: T
): Promise<void> {
// TODO just throw to be handled by the subscriber
return await this.atomicPhase_(async (transactionManager) => {
const batchJob = (await this.batchJobService_
.withTransaction(transactionManager)
@@ -95,7 +96,7 @@ export abstract class AbstractBatchJobStrategy
},
result: {
...result,
errors: [...existingErrors, resultError],
errors: [...existingErrors, resultError.message],
},
})
} else {