quidproquo-core 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/qpqRuntime.js +10 -2
- package/package.json +1 -1
package/lib/qpqRuntime.js
CHANGED
|
@@ -18,9 +18,17 @@ function processAction(action, actionProcessors, session) {
|
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
// Special action ~ batch - needs access to the processAction / actionProcessor context
|
|
20
20
|
if (action.type === SystemActionType_1.SystemActionType.Batch) {
|
|
21
|
-
|
|
21
|
+
const batchRes = yield Promise.all(action.payload.actions.map((a) => {
|
|
22
22
|
return a ? processAction(a, actionProcessors, session) : null;
|
|
23
|
-
}))
|
|
23
|
+
}));
|
|
24
|
+
// If there was an error, throw that error back
|
|
25
|
+
const erroredBatchItem = batchRes.find((br) => (0, actionLogic_1.isErroredActionResult)(br));
|
|
26
|
+
if (erroredBatchItem) {
|
|
27
|
+
const error = (0, actionLogic_1.resolveActionResultError)(erroredBatchItem);
|
|
28
|
+
return (0, actionLogic_1.actionResultError)(ErrorTypeEnum_1.ErrorTypeEnum.GenericError, error.errorText, error.errorStack);
|
|
29
|
+
}
|
|
30
|
+
// unwrap the values
|
|
31
|
+
return (0, actionLogic_1.actionResult)(batchRes.map((br) => (0, actionLogic_1.resolveActionResult)(br)));
|
|
24
32
|
}
|
|
25
33
|
const processor = actionProcessors === null || actionProcessors === void 0 ? void 0 : actionProcessors[action === null || action === void 0 ? void 0 : action.type];
|
|
26
34
|
if (!processor) {
|