feat(editor): Improve errors in output panel (#8644)
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ApplicationError, type IDataObject, type NodeApiError } from 'n8n-workflow';
|
||||
import type { UpdateRecord } from './interfaces';
|
||||
import set from 'lodash/set';
|
||||
|
||||
export function removeIgnored(data: IDataObject, ignore: string | string[]) {
|
||||
if (ignore) {
|
||||
@@ -66,13 +67,18 @@ export function findMatches(
|
||||
}
|
||||
}
|
||||
|
||||
export function processAirtableError(error: NodeApiError, id?: string) {
|
||||
export function processAirtableError(error: NodeApiError, id?: string, itemIndex?: number) {
|
||||
if (error.description === 'NOT_FOUND' && id) {
|
||||
error.description = `${id} is not a valid Record ID`;
|
||||
}
|
||||
if (error.description?.includes('You must provide an array of up to 10 record objects') && id) {
|
||||
error.description = `${id} is not a valid Record ID`;
|
||||
}
|
||||
|
||||
if (itemIndex !== undefined) {
|
||||
set(error, 'context.itemIndex', itemIndex);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user