mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(Read/Write Files from Disk Node): Better error handling when file name missing (no-changelog) (#10463)
This commit is contained in:
parent
17ac7844f2
commit
6a0f2ca96b
|
@ -1,4 +1,10 @@
|
|||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import glob from 'fast-glob';
|
||||
import { errorMapper } from '../helpers/utils';
|
||||
|
@ -124,7 +130,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
returnData.push(...newItems);
|
||||
} catch (error) {
|
||||
const nodeOperatioinError = errorMapper.call(this, error, itemIndex, {
|
||||
|
@ -142,7 +147,7 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
});
|
||||
continue;
|
||||
}
|
||||
throw nodeOperatioinError;
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import type { Readable } from 'stream';
|
||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { BINARY_ENCODING } from 'n8n-workflow';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { errorMapper } from '../helpers/utils';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
@ -114,7 +119,7 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
});
|
||||
continue;
|
||||
}
|
||||
throw nodeOperatioinError;
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue