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

@@ -3,7 +3,7 @@ import { Container, Service } from '@n8n/di';
import { Router } from 'express';
import type { Application, Request, Response, RequestHandler } from 'express';
import { rateLimit as expressRateLimit } from 'express-rate-limit';
import { ApplicationError } from 'n8n-workflow';
import { UnexpectedError } from 'n8n-workflow';
import type { ZodClass } from 'zod-class';
import { AuthService } from '@/auth/auth.service';
@@ -100,7 +100,7 @@ export class ControllerRegistry {
return res.status(400).json(output.error.errors[0]);
}
}
} else throw new ApplicationError('Unknown arg type: ' + arg.type);
} else throw new UnexpectedError('Unknown arg type: ' + arg.type);
}
return await controller[handlerName](...args);
};