mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
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:
@@ -21,7 +21,7 @@ import type {
|
||||
ILocalLoadOptionsFunctions,
|
||||
IExecuteData,
|
||||
} from 'n8n-workflow';
|
||||
import { Workflow, ApplicationError } from 'n8n-workflow';
|
||||
import { Workflow, UnexpectedError } from 'n8n-workflow';
|
||||
|
||||
import { NodeTypes } from '@/node-types';
|
||||
|
||||
@@ -91,7 +91,7 @@ export class DynamicNodeParametersService {
|
||||
// requiring a baseURL to be defined can at least not a random server be called.
|
||||
// In the future this code has to get improved that it does not use the request information from
|
||||
// the request rather resolves it via the parameter-path and nodeType data.
|
||||
throw new ApplicationError(
|
||||
throw new UnexpectedError(
|
||||
'Node type does not exist or does not have "requestDefaults.baseURL" defined!',
|
||||
{ tags: { nodeType: nodeType.description.name } },
|
||||
);
|
||||
@@ -152,7 +152,7 @@ export class DynamicNodeParametersService {
|
||||
}
|
||||
|
||||
if (!Array.isArray(optionsData)) {
|
||||
throw new ApplicationError('The returned data is not an array');
|
||||
throw new UnexpectedError('The returned data is not an array');
|
||||
}
|
||||
|
||||
return optionsData[0].map((item) => item.json) as unknown as INodePropertyOptions[];
|
||||
@@ -258,7 +258,7 @@ export class DynamicNodeParametersService {
|
||||
): NodeMethod {
|
||||
const method = nodeType.methods?.[type]?.[methodName] as NodeMethod;
|
||||
if (typeof method !== 'function') {
|
||||
throw new ApplicationError('Node type does not have method defined', {
|
||||
throw new UnexpectedError('Node type does not have method defined', {
|
||||
tags: { nodeType: nodeType.description.name },
|
||||
extra: { methodName },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user