Add continueOnFail support to AWS Transcribe Node

This commit is contained in:
Jan Oberhauser 2021-05-29 21:50:07 -05:00
parent 2d9c2e1a1e
commit a9184e38f8

View file

@ -411,6 +411,7 @@ export class AwsTranscribe implements INodeType {
const resource = this.getNodeParameter('resource', 0) as string; const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string; const operation = this.getNodeParameter('operation', 0) as string;
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
try {
if (resource === 'transcriptionJob') { if (resource === 'transcriptionJob') {
//https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectDominantLanguage.html //https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectDominantLanguage.html
if (operation === 'create') { if (operation === 'create') {
@ -538,6 +539,14 @@ export class AwsTranscribe implements INodeType {
} else { } else {
returnData.push(responseData as IDataObject); returnData.push(responseData as IDataObject);
} }
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ error: error.message });
continue;
}
throw error;
}
} }
return [this.helpers.returnJsonArray(returnData)]; return [this.helpers.returnJsonArray(returnData)];
} }