refactor(core): Switch plain errors in cli to ApplicationError (#7857)

Ensure all errors in `cli` are `ApplicationError` or children of it and
contain no variables in the message, to continue normalizing all the
errors we report to Sentry

Follow-up to: https://github.com/n8n-io/n8n/pull/7839
This commit is contained in:
Iván Ovejero
2023-11-29 12:25:10 +01:00
committed by GitHub
parent 87def60979
commit c08c5cc37b
58 changed files with 277 additions and 195 deletions

View File

@@ -7,6 +7,7 @@ import type { ICredentialsDb, ICredentialsDecryptedDb } from '@/Interfaces';
import { BaseCommand } from '../BaseCommand';
import { CredentialsRepository } from '@db/repositories/credentials.repository';
import Container from 'typedi';
import { ApplicationError } from 'n8n-workflow';
export class ExportCredentialsCommand extends BaseCommand {
static description = 'Export credentials';
@@ -125,7 +126,7 @@ export class ExportCredentialsCommand extends BaseCommand {
}
if (credentials.length === 0) {
throw new Error('No credentials found with specified filters.');
throw new ApplicationError('No credentials found with specified filters');
}
if (flags.separate) {