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 data = await new Processor(flow, {
|
||||
const executionStep = await new Processor(flow, {
|
||||
untilStep,
|
||||
testRun: true,
|
||||
}).run();
|
||||
@@ -33,7 +33,11 @@ const executeFlow = async (
|
||||
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;
|
||||
|
@@ -160,11 +160,7 @@ class Processor {
|
||||
.orderBy('created_at', 'desc')
|
||||
.first();
|
||||
|
||||
if (lastExecutionStepFromFirstExecution.errorDetails) {
|
||||
return lastExecutionStepFromFirstExecution.errorDetails;
|
||||
} else {
|
||||
return lastExecutionStepFromFirstExecution?.dataOut;
|
||||
}
|
||||
return lastExecutionStepFromFirstExecution;
|
||||
}
|
||||
|
||||
async getInitialTriggerData(step: Step) {
|
||||
|
Reference in New Issue
Block a user