mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
chore: Convert ErrorReporting to a Service to use DI. Add some tests (no-changelog) (#11279)
This commit is contained in:
committed by
GitHub
parent
5300e0ac45
commit
73145b70b8
@@ -11,7 +11,6 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
ApplicationError,
|
||||
ErrorReporterProxy as ErrorReporter,
|
||||
LoggerProxy as Logger,
|
||||
toCronExpression,
|
||||
TriggerCloseError,
|
||||
@@ -20,12 +19,16 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
import { Service } from 'typedi';
|
||||
|
||||
import { ErrorReporter } from './error-reporter';
|
||||
import type { IWorkflowData } from './Interfaces';
|
||||
import { ScheduledTaskManager } from './ScheduledTaskManager';
|
||||
|
||||
@Service()
|
||||
export class ActiveWorkflows {
|
||||
constructor(private readonly scheduledTaskManager: ScheduledTaskManager) {}
|
||||
constructor(
|
||||
private readonly scheduledTaskManager: ScheduledTaskManager,
|
||||
private readonly errorReporter: ErrorReporter,
|
||||
) {}
|
||||
|
||||
private activeWorkflows: { [workflowId: string]: IWorkflowData } = {};
|
||||
|
||||
@@ -218,7 +221,7 @@ export class ActiveWorkflows {
|
||||
Logger.error(
|
||||
`There was a problem calling "closeFunction" on "${e.node.name}" in workflow "${workflowId}"`,
|
||||
);
|
||||
ErrorReporter.error(e, { extra: { workflowId } });
|
||||
this.errorReporter.error(e, { extra: { workflowId } });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user