Skip to content

Commit 07dd04e

Browse files
authored
chore: release v1.0.11 (#25)
1 parent 6959071 commit 07dd04e

File tree

3 files changed

+103
-101
lines changed

3 files changed

+103
-101
lines changed

nodes/hostingerApi/HostingerApi.node.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
INodeType,
88
INodeTypeDescription,
99
NodeConnectionTypes,
10+
NodeOperationError,
1011
} from 'n8n-workflow';
1112

1213

@@ -30,6 +31,7 @@ export class HostingerApi implements INodeType {
3031
required: true,
3132
},
3233
],
34+
usableAsTool: true,
3335
properties: [
3436
{
3537
displayName: 'Category',
@@ -913,6 +915,7 @@ export class HostingerApi implements INodeType {
913915
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
914916
const items = this.getInputData();
915917
const returnData: INodeExecutionData[] = [];
918+
const continueOnFail = this.continueOnFail();
916919

917920
for (let i = 0; i < items.length; i++) {
918921

@@ -1124,9 +1127,29 @@ export class HostingerApi implements INodeType {
11241127

11251128
try {
11261129
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'hostingerApi', requestConfig);
1127-
returnData.push({ json: { response } });
1130+
returnData.push({ json: { response }, pairedItem: { item: i } });
11281131
} catch (error) {
1129-
returnData.push({ json: { error: (error as Error).message, request: requestConfig } });
1132+
if (continueOnFail) {
1133+
const executionError = new NodeOperationError(
1134+
this.getNode(),
1135+
error as Error,
1136+
{ itemIndex: i }
1137+
);
1138+
returnData.push({
1139+
json: {
1140+
error: (error as Error).message,
1141+
request: requestConfig
1142+
},
1143+
pairedItem: { item: i },
1144+
error: executionError
1145+
});
1146+
} else {
1147+
throw new NodeOperationError(
1148+
this.getNode(),
1149+
error as Error,
1150+
{ itemIndex: i }
1151+
);
1152+
}
11301153
}
11311154
}
11321155

0 commit comments

Comments
 (0)