refactor(core): Switch plain errors in core to ApplicationError (no-changelog) (#7873)

Ensure all errors in `core` 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/7857
This commit is contained in:
Iván Ovejero
2023-11-30 09:06:19 +01:00
committed by GitHub
parent cd474f1562
commit b16dd21909
10 changed files with 135 additions and 101 deletions

View File

@@ -13,6 +13,7 @@ import type {
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
ApplicationError,
LoggerProxy as Logger,
toCronExpression,
WorkflowActivationError,
@@ -177,7 +178,9 @@ export class ActiveWorkflows {
for (const cronTime of cronTimes) {
const cronTimeParts = cronTime.split(' ');
if (cronTimeParts.length > 0 && cronTimeParts[0].includes('*')) {
throw new Error('The polling interval is too short. It has to be at least a minute!');
throw new ApplicationError(
'The polling interval is too short. It has to be at least a minute!',
);
}
cronJobs.push(new CronJob(cronTime, executeTrigger, undefined, true, timezone));