Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Prevent app crashes because of unhandled promises in poll and trigger nodes #6278

Merged
merged 1 commit into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/cli/src/ActiveWorkflowRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,10 @@ export class ActiveWorkflowRunner {
}
};

returnFunctions.__emitError = async (error: ExecutionError): Promise<void> => {
await createErrorExecution(error, node, workflowData, workflow, mode);
this.executeErrorWorkflow(error, workflowData, mode);
returnFunctions.__emitError = (error: ExecutionError): void => {
void createErrorExecution(error, node, workflowData, workflow, mode).then(() => {
this.executeErrorWorkflow(error, workflowData, mode);
});
};
return returnFunctions;
};
Expand Down Expand Up @@ -707,7 +708,7 @@ export class ActiveWorkflowRunner {
executePromise.catch(Logger.error);
}
};
returnFunctions.emitError = async (error: Error): Promise<void> => {
returnFunctions.emitError = (error: Error): void => {
Logger.info(
`The trigger node "${node.name}" of workflow "${workflowData.name}" failed with the error: "${error.message}". Will try to reactivate.`,
{
Expand All @@ -719,7 +720,7 @@ export class ActiveWorkflowRunner {

// Remove the workflow as "active"

await this.activeWorkflows.remove(workflowData.id);
void this.activeWorkflows.remove(workflowData.id);
this.activationErrors[workflowData.id] = {
time: new Date().getTime(),
error: {
Expand Down