mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -1,5 +1,5 @@
|
||||
import type { IRun, WorkflowTestData } from 'n8n-workflow';
|
||||
import { createDeferredPromise, Workflow } from 'n8n-workflow';
|
||||
import { ApplicationError, createDeferredPromise, Workflow } from 'n8n-workflow';
|
||||
import { WorkflowExecute } from '@/WorkflowExecute';
|
||||
|
||||
import * as Helpers from './helpers';
|
||||
@@ -45,7 +45,7 @@ describe('WorkflowExecute', () => {
|
||||
// Check if the output data of the nodes is correct
|
||||
for (const nodeName of Object.keys(testData.output.nodeData)) {
|
||||
if (result.data.resultData.runData[nodeName] === undefined) {
|
||||
throw new Error(`Data for node "${nodeName}" is missing!`);
|
||||
throw new ApplicationError('Data for node is missing', { extra: { nodeName } });
|
||||
}
|
||||
|
||||
const resultData = result.data.resultData.runData[nodeName].map((nodeData) => {
|
||||
@@ -108,7 +108,7 @@ describe('WorkflowExecute', () => {
|
||||
// Check if the output data of the nodes is correct
|
||||
for (const nodeName of Object.keys(testData.output.nodeData)) {
|
||||
if (result.data.resultData.runData[nodeName] === undefined) {
|
||||
throw new Error(`Data for node "${nodeName}" is missing!`);
|
||||
throw new ApplicationError('Data for node is missing', { extra: { nodeName } });
|
||||
}
|
||||
|
||||
const resultData = result.data.resultData.runData[nodeName].map((nodeData) => {
|
||||
@@ -172,7 +172,7 @@ describe('WorkflowExecute', () => {
|
||||
// Check if the output data of the nodes is correct
|
||||
for (const nodeName of Object.keys(testData.output.nodeData)) {
|
||||
if (result.data.resultData.runData[nodeName] === undefined) {
|
||||
throw new Error(`Data for node "${nodeName}" is missing!`);
|
||||
throw new ApplicationError('Data for node is missing', { extra: { nodeName } });
|
||||
}
|
||||
|
||||
const resultData = result.data.resultData.runData[nodeName].map((nodeData) => {
|
||||
|
||||
Reference in New Issue
Block a user