Skip to content

Commit f25ecac

Browse files
committed
continue on fail support
1 parent 911f170 commit f25ecac

1 file changed

Lines changed: 31 additions & 18 deletions

File tree

nodes/CloudConvert/CloudConvert.node.ts

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -316,24 +316,37 @@ export class CloudConvert implements INodeType {
316316
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
317317
const operation = this.getNodeParameter('operation', 0);
318318

319-
if (operation === 'convert') {
320-
return executeConvert.call(this);
321-
} else if (operation === 'thumbnail') {
322-
return executeThumbnail.call(this);
323-
} else if (operation === 'merge') {
324-
return executeMerge.call(this);
325-
} else if (operation === 'archive') {
326-
return executeArchive.call(this);
327-
} else if (operation === 'optimize') {
328-
return executeOptimize.call(this);
329-
} else if (operation === 'watermark') {
330-
return executeWatermark.call(this);
331-
} else if (operation === 'metadata') {
332-
return executeMetadata.call(this);
333-
} else if (operation === 'capture-website') {
334-
return executeCaptureWebsite.call(this);
335-
} else {
336-
throw new NodeOperationError(this.getNode(), `Invalid operation ${operation}`);
319+
try {
320+
if (operation === 'convert') {
321+
return await executeConvert.call(this);
322+
} else if (operation === 'thumbnail') {
323+
return await executeThumbnail.call(this);
324+
} else if (operation === 'merge') {
325+
return await executeMerge.call(this);
326+
} else if (operation === 'archive') {
327+
return await executeArchive.call(this);
328+
} else if (operation === 'optimize') {
329+
return await executeOptimize.call(this);
330+
} else if (operation === 'watermark') {
331+
return await executeWatermark.call(this);
332+
} else if (operation === 'metadata') {
333+
return await executeMetadata.call(this);
334+
} else if (operation === 'capture-website') {
335+
return await executeCaptureWebsite.call(this);
336+
} else {
337+
throw new NodeOperationError(this.getNode(), `Invalid operation ${operation}`);
338+
}
339+
} catch (error) {
340+
if (this.continueOnFail()) {
341+
return this.prepareOutputData([
342+
{
343+
json: {
344+
error: error.message,
345+
},
346+
},
347+
]);
348+
}
349+
throw error;
337350
}
338351
}
339352
}

0 commit comments

Comments
 (0)