mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Read/Write Files from Disk Node): Better error handling when file name missing (no-changelog) (#10463)
This commit is contained in:
@@ -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 glob from 'fast-glob';
|
||||||
import { errorMapper } from '../helpers/utils';
|
import { errorMapper } from '../helpers/utils';
|
||||||
@@ -124,7 +130,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
returnData.push(...newItems);
|
returnData.push(...newItems);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const nodeOperatioinError = errorMapper.call(this, error, itemIndex, {
|
const nodeOperatioinError = errorMapper.call(this, error, itemIndex, {
|
||||||
@@ -142,7 +147,7 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw nodeOperatioinError;
|
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'stream';
|
||||||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
import type {
|
||||||
import { BINARY_ENCODING } from 'n8n-workflow';
|
IExecuteFunctions,
|
||||||
|
INodeExecutionData,
|
||||||
|
INodeProperties,
|
||||||
|
JsonObject,
|
||||||
|
} from 'n8n-workflow';
|
||||||
|
import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow';
|
||||||
|
|
||||||
import { errorMapper } from '../helpers/utils';
|
import { errorMapper } from '../helpers/utils';
|
||||||
import { updateDisplayOptions } from '@utils/utilities';
|
import { updateDisplayOptions } from '@utils/utilities';
|
||||||
@@ -114,7 +119,7 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw nodeOperatioinError;
|
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user