mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(core): Prevent app crashes because of unhandled promises in poll and trigger nodes (#6278)
fixes https://community.n8n.io/t/n8n-server-container-after-read-econnreset-and-write-epipe-errors-in-imap-version-2-node/24012
This commit is contained in:
parent
be5d3264ad
commit
37506050c3
|
@ -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;
|
||||
};
|
||||
|
@ -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.`,
|
||||
{
|
||||
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue