mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor: Switch plain errors in nodes-base to ApplicationError (no-changelog) (#7914)
Ensure all errors in `nodes-base` are `ApplicationError` or children of it and contain no variables in the message, to continue normalizing all the backend errors we report to Sentry. Also, skip reporting to Sentry errors from user input and from external APIs. In future we should refine `ApplicationError` to more specific errors. Follow-up to: [#7877](https://github.com/n8n-io/n8n/pull/7877) - [x] Test workflows: https://github.com/n8n-io/n8n/actions/runs/7084627970 - [x] e2e: https://github.com/n8n-io/n8n/actions/runs/7084936861 --------- Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import { ApplicationError, type IDataObject } from 'n8n-workflow';
|
||||
|
||||
import get from 'lodash/get';
|
||||
import set from 'lodash/set';
|
||||
@@ -54,7 +54,9 @@ export function prepareInputItem(item: IDataObject, schema: IDataObject[], i: nu
|
||||
set(returnData, id, value);
|
||||
} else {
|
||||
if (entry.required) {
|
||||
throw new Error(`Required field "${id}" is missing in item ${i}`);
|
||||
throw new ApplicationError(`Required field "${id}" is missing in item ${i}`, {
|
||||
level: 'warning',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user