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,5 +1,5 @@
|
||||
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import { deepCopy, assert } from 'n8n-workflow';
|
||||
import { deepCopy, assert, ApplicationError } from 'n8n-workflow';
|
||||
|
||||
import type {
|
||||
AdjustedPutItem,
|
||||
@@ -98,7 +98,7 @@ export function validateJSON(input: any): object {
|
||||
try {
|
||||
return JSON.parse(input as string);
|
||||
} catch (error) {
|
||||
throw new Error('Items must be a valid JSON');
|
||||
throw new ApplicationError('Items must be a valid JSON', { level: 'warning' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user