mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31: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
@@ -4,6 +4,7 @@ import fsPromises from 'fs/promises';
|
||||
import type { Class, DirectoryLoader, Types } from 'n8n-core';
|
||||
import {
|
||||
CUSTOM_EXTENSION_ENV,
|
||||
ErrorReporter,
|
||||
InstanceSettings,
|
||||
CustomDirectoryLoader,
|
||||
PackageDirectoryLoader,
|
||||
@@ -22,7 +23,7 @@ import type {
|
||||
INodeType,
|
||||
IVersionedNodeType,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeHelpers, ApplicationError, ErrorReporterProxy as ErrorReporter } from 'n8n-workflow';
|
||||
import { NodeHelpers, ApplicationError } from 'n8n-workflow';
|
||||
import path from 'path';
|
||||
import picocolors from 'picocolors';
|
||||
import { Container, Service } from 'typedi';
|
||||
@@ -63,6 +64,7 @@ export class LoadNodesAndCredentials {
|
||||
|
||||
constructor(
|
||||
private readonly logger: Logger,
|
||||
private readonly errorReporter: ErrorReporter,
|
||||
private readonly instanceSettings: InstanceSettings,
|
||||
private readonly globalConfig: GlobalConfig,
|
||||
) {}
|
||||
@@ -155,7 +157,7 @@ export class LoadNodesAndCredentials {
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.error((error as Error).message);
|
||||
ErrorReporter.error(error);
|
||||
this.errorReporter.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user