refactor(core): Remove a floating promise

This commit is contained in:
Jan Oberhauser 2022-06-04 12:33:49 +02:00
parent 3806d6355d
commit eb766e2ced

View file

@ -135,15 +135,26 @@ function executeErrorWorkflow(
// make sure there are no possible security gaps // make sure there are no possible security gaps
return; return;
} }
getWorkflowOwner(workflowData.id)
// eslint-disable-next-line @typescript-eslint/no-floating-promises .then((user) => {
getWorkflowOwner(workflowData.id).then((user) => { void WorkflowHelpers.executeErrorWorkflow(
void WorkflowHelpers.executeErrorWorkflow( workflowData.settings!.errorWorkflow as string,
workflowData.settings!.errorWorkflow as string, workflowErrorData,
workflowErrorData, user,
user, );
); })
}); .catch((error) => {
Logger.error(
`Could not execute ErrorWorkflow for execution ID ${this.executionId} because of error querying the workflow owner`,
{
executionId,
errorWorkflowId: workflowData.settings!.errorWorkflow!.toString(),
workflowId: workflowData.id,
error,
workflowErrorData,
},
);
});
} else if ( } else if (
mode !== 'error' && mode !== 'error' &&
workflowData.id !== undefined && workflowData.id !== undefined &&