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:
@@ -8,7 +8,12 @@ import type {
|
||||
SelectQueryBuilder,
|
||||
} from 'typeorm';
|
||||
import { parse, stringify } from 'flatted';
|
||||
import type { ExecutionStatus, IExecutionsSummary, IRunExecutionData } from 'n8n-workflow';
|
||||
import {
|
||||
ApplicationError,
|
||||
type ExecutionStatus,
|
||||
type IExecutionsSummary,
|
||||
type IRunExecutionData,
|
||||
} from 'n8n-workflow';
|
||||
import { BinaryDataService } from 'n8n-core';
|
||||
import type {
|
||||
ExecutionPayload,
|
||||
@@ -381,7 +386,9 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
||||
},
|
||||
) {
|
||||
if (!deleteConditions?.deleteBefore && !deleteConditions?.ids) {
|
||||
throw new Error('Either "deleteBefore" or "ids" must be present in the request body');
|
||||
throw new ApplicationError(
|
||||
'Either "deleteBefore" or "ids" must be present in the request body',
|
||||
);
|
||||
}
|
||||
|
||||
const query = this.createQueryBuilder('execution')
|
||||
|
||||
Reference in New Issue
Block a user