fix: Expose errors within execute flow mutation
This commit is contained in:
@@ -24,7 +24,7 @@ const executeFlow = async (
|
|||||||
|
|
||||||
const flow = await untilStep.$relatedQuery('flow');
|
const flow = await untilStep.$relatedQuery('flow');
|
||||||
|
|
||||||
const data = await new Processor(flow, {
|
const executionStep = await new Processor(flow, {
|
||||||
untilStep,
|
untilStep,
|
||||||
testRun: true,
|
testRun: true,
|
||||||
}).run();
|
}).run();
|
||||||
@@ -33,7 +33,11 @@ const executeFlow = async (
|
|||||||
status: 'completed',
|
status: 'completed',
|
||||||
});
|
});
|
||||||
|
|
||||||
return { data, step: untilStep };
|
if (executionStep.errorDetails) {
|
||||||
|
throw new Error(JSON.stringify(executionStep.errorDetails, null, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
return { data: executionStep.dataOut, step: untilStep };
|
||||||
};
|
};
|
||||||
|
|
||||||
export default executeFlow;
|
export default executeFlow;
|
||||||
|
@@ -160,11 +160,7 @@ class Processor {
|
|||||||
.orderBy('created_at', 'desc')
|
.orderBy('created_at', 'desc')
|
||||||
.first();
|
.first();
|
||||||
|
|
||||||
if (lastExecutionStepFromFirstExecution.errorDetails) {
|
return lastExecutionStepFromFirstExecution;
|
||||||
return lastExecutionStepFromFirstExecution.errorDetails;
|
|
||||||
} else {
|
|
||||||
return lastExecutionStepFromFirstExecution?.dataOut;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getInitialTriggerData(step: Step) {
|
async getInitialTriggerData(step: Step) {
|
||||||
|
Reference in New Issue
Block a user