refactor: Remove usless catch blocks, and add a linting rule to prevent them (no-changelog) (#12730)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-20 18:20:04 +01:00
committed by GitHub
parent 4ee4552b0e
commit 202da76380
17 changed files with 220 additions and 242 deletions

View File

@@ -16,19 +16,15 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
operation,
} as WebflowType;
try {
switch (webflowNodeData.resource) {
case 'item':
returnData = await item[webflowNodeData.operation].execute.call(this, items);
break;
default:
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not supported!`,
);
}
} catch (error) {
throw error;
switch (webflowNodeData.resource) {
case 'item':
returnData = await item[webflowNodeData.operation].execute.call(this, items);
break;
default:
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not supported!`,
);
}
return [returnData];