refactor(core): Migrate all errors in cli package to new hierarchy (#13478)

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Iván Ovejero
2025-02-27 08:30:55 +01:00
committed by GitHub
parent 719e3c2cf7
commit 3ca99194c6
107 changed files with 340 additions and 354 deletions

View File

@@ -6,7 +6,7 @@ import type { PushMessage, PushType } from '@n8n/api-types';
import { GlobalConfig } from '@n8n/config';
import { Container } from '@n8n/di';
import { Logger, WorkflowExecute } from 'n8n-core';
import { ApplicationError, Workflow } from 'n8n-workflow';
import { UnexpectedError, Workflow } from 'n8n-workflow';
import type {
IDataObject,
IExecuteData,
@@ -105,7 +105,7 @@ export async function getWorkflowData(
parentWorkflowSettings?: IWorkflowSettings,
): Promise<IWorkflowBase> {
if (workflowInfo.id === undefined && workflowInfo.code === undefined) {
throw new ApplicationError(
throw new UnexpectedError(
'No information about the workflow to execute found. Please provide either the "id" or "code"!',
);
}
@@ -120,7 +120,7 @@ export async function getWorkflowData(
);
if (workflowData === undefined || workflowData === null) {
throw new ApplicationError('Workflow does not exist.', {
throw new UnexpectedError('Workflow does not exist.', {
extra: { workflowId: workflowInfo.id },
});
}