mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-28 22:30:37 +02:00
fix(Telegram Node): Include error message in output when continueOnFail is set (#15540)
This commit is contained in:
@@ -2195,7 +2195,11 @@ export class Telegram implements INodeType {
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ json: {}, error: error.message });
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.description ?? error.message }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionErrorData);
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -556,7 +556,9 @@
|
||||
],
|
||||
"No Operation, do nothing1": [
|
||||
{
|
||||
"json": {}
|
||||
"json": {
|
||||
"error": "Chat not found"
|
||||
}
|
||||
}
|
||||
],
|
||||
"No Operation, do nothing2": [
|
||||
|
||||
@@ -28,6 +28,7 @@ describe('Telegram', () => {
|
||||
const mock = nock(credentials.telegramApi.baseUrl);
|
||||
|
||||
mock.post('/bottestToken/getChat').reply(200, getChatResponse);
|
||||
mock.post('/bottestToken/getChat').reply(404, { error: 'Chat not found' });
|
||||
mock.post('/bottestToken/sendMessage').reply(200, sendMessageResponse);
|
||||
mock.post('/bottestToken/sendMediaGroup').reply(200, sendMediaGroupResponse);
|
||||
mock.post('/bottestToken/sendLocation').reply(200, sendLocationMessageResponse);
|
||||
|
||||
Reference in New Issue
Block a user