fix(Telegram Node): Include error message in output when continueOnFail is set (#15540)

This commit is contained in:
Elias Meire
2025-05-26 11:30:23 +02:00
committed by GitHub
parent 43d5b954a4
commit b8ee275f0b
3 changed files with 9 additions and 2 deletions
@@ -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);