fix(EmailReadImap Node): Fix issue that crashed process if node was configured wrong (#3079)

* 🐛 Fix issue that IMAP node can crash n8n

* 👕 Fix lint issue
This commit is contained in:
Jan Oberhauser
2022-04-02 17:33:31 +02:00
committed by GitHub
parent 2c72584b55
commit 85f15d4989
5 changed files with 41 additions and 8 deletions

View File

@@ -682,6 +682,15 @@ export class ActiveWorkflowRunner {
(error) => console.error(error),
);
};
returnFunctions.emitError = async (error: Error): Promise<void> => {
await this.activeWorkflows?.remove(workflowData.id.toString());
this.activationErrors[workflowData.id.toString()] = {
time: new Date().getTime(),
error: {
message: error.message,
},
};
};
return returnFunctions;
};
}