diff --git a/packages/core/src/credentials.ts b/packages/core/src/credentials.ts index 5aee657bbfe..5dc515ed858 100644 --- a/packages/core/src/credentials.ts +++ b/packages/core/src/credentials.ts @@ -1,13 +1,13 @@ import { isObjectLiteral } from '@n8n/backend-common'; import { Container } from '@n8n/di'; import type { ICredentialDataDecryptedObject, ICredentialsEncrypted } from 'n8n-workflow'; -import { ApplicationError, ICredentials, jsonParse, UnexpectedError } from 'n8n-workflow'; +import { ICredentials, jsonParse, OperationalError, UnexpectedError } from 'n8n-workflow'; import * as a from 'node:assert'; import { CREDENTIAL_ERRORS } from '@/constants'; import { Cipher } from '@/encryption/cipher'; -export class CredentialDataError extends ApplicationError { +export class CredentialDataError extends OperationalError { constructor({ name, type, id }: Credentials, message: string, cause?: unknown) { super(message, { extra: { name, type, id }, diff --git a/packages/core/src/errors/abstract/binary-data.error.ts b/packages/core/src/errors/abstract/binary-data.error.ts deleted file mode 100644 index 58403d6d105..00000000000 --- a/packages/core/src/errors/abstract/binary-data.error.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ApplicationError } from '@n8n/errors'; - -export abstract class BinaryDataError extends ApplicationError {} diff --git a/packages/core/src/errors/abstract/filesystem.error.ts b/packages/core/src/errors/abstract/filesystem.error.ts deleted file mode 100644 index 405f3610d58..00000000000 --- a/packages/core/src/errors/abstract/filesystem.error.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ApplicationError } from '@n8n/errors'; - -export abstract class FileSystemError extends ApplicationError { - constructor(message: string, filePath: string) { - super(message, { extra: { filePath } }); - } -} diff --git a/packages/core/src/errors/disallowed-filepath.error.ts b/packages/core/src/errors/disallowed-filepath.error.ts index 4d6ac5684d2..9d846ed6083 100644 --- a/packages/core/src/errors/disallowed-filepath.error.ts +++ b/packages/core/src/errors/disallowed-filepath.error.ts @@ -1,7 +1,7 @@ -import { FileSystemError } from './abstract/filesystem.error'; +import { UserError } from 'n8n-workflow'; -export class DisallowedFilepathError extends FileSystemError { +export class DisallowedFilepathError extends UserError { constructor(filePath: string) { - super('Disallowed path detected', filePath); + super('Disallowed path detected', { extra: { filePath } }); } } diff --git a/packages/core/src/errors/file-not-found.error.ts b/packages/core/src/errors/file-not-found.error.ts index 208bb0d354e..3a2660c578a 100644 --- a/packages/core/src/errors/file-not-found.error.ts +++ b/packages/core/src/errors/file-not-found.error.ts @@ -1,7 +1,7 @@ -import { FileSystemError } from './abstract/filesystem.error'; +import { UserError } from 'n8n-workflow'; -export class FileNotFoundError extends FileSystemError { +export class FileNotFoundError extends UserError { constructor(filePath: string) { - super('File not found', filePath); + super('File not found', { extra: { filePath } }); } } diff --git a/packages/core/src/errors/invalid-execution-metadata.error.ts b/packages/core/src/errors/invalid-execution-metadata.error.ts index 088f4d12955..34e5c05c241 100644 --- a/packages/core/src/errors/invalid-execution-metadata.error.ts +++ b/packages/core/src/errors/invalid-execution-metadata.error.ts @@ -1,6 +1,6 @@ -import { ApplicationError } from '@n8n/errors'; +import { UserError } from 'n8n-workflow'; -export class InvalidExecutionMetadataError extends ApplicationError { +export class InvalidExecutionMetadataError extends UserError { constructor( public type: 'key' | 'value', key: unknown, diff --git a/packages/core/src/errors/invalid-manager.error.ts b/packages/core/src/errors/invalid-manager.error.ts index ecd1f75ca3f..0e51aa1d6a3 100644 --- a/packages/core/src/errors/invalid-manager.error.ts +++ b/packages/core/src/errors/invalid-manager.error.ts @@ -1,6 +1,6 @@ -import { BinaryDataError } from './abstract/binary-data.error'; +import { UserError } from 'n8n-workflow'; -export class InvalidManagerError extends BinaryDataError { +export class InvalidManagerError extends UserError { constructor(mode: string) { super(`No binary data manager found for: ${mode}`); }