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

@@ -9,7 +9,7 @@ import { In, type FindOptionsRelations } from '@n8n/typeorm';
import axios from 'axios';
import express from 'express';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow';
import { UnexpectedError } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import type { Project } from '@/databases/entities/project';
@@ -154,7 +154,7 @@ export class WorkflowsController {
// Safe guard in case the personal project does not exist for whatever reason.
if (project === null) {
throw new ApplicationError('No personal project found');
throw new UnexpectedError('No personal project found');
}
if (parentFolderId) {
@@ -401,15 +401,11 @@ export class WorkflowsController {
@Query query: ManualRunQueryDto,
) {
if (!req.body.workflowData.id) {
throw new ApplicationError('You cannot execute a workflow without an ID', {
level: 'warning',
});
throw new UnexpectedError('You cannot execute a workflow without an ID');
}
if (req.params.workflowId !== req.body.workflowData.id) {
throw new ApplicationError('Workflow ID in body does not match workflow ID in URL', {
level: 'warning',
});
throw new UnexpectedError('Workflow ID in body does not match workflow ID in URL');
}
if (this.license.isSharingEnabled()) {