mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Remove usless catch blocks, and add a linting rule to prevent them (no-changelog) (#12730)
This commit is contained in:
committed by
GitHub
parent
4ee4552b0e
commit
202da76380
@@ -214,7 +214,6 @@ export class MailchimpTrigger implements INodeType {
|
||||
},
|
||||
|
||||
async create(this: IHookFunctions): Promise<boolean> {
|
||||
let webhook;
|
||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||
const listId = this.getNodeParameter('list') as string;
|
||||
const events = this.getNodeParameter('events', []) as string[];
|
||||
@@ -233,11 +232,7 @@ export class MailchimpTrigger implements INodeType {
|
||||
}, {}),
|
||||
};
|
||||
const endpoint = `/lists/${listId}/webhooks`;
|
||||
try {
|
||||
webhook = await mailchimpApiRequest.call(this, endpoint, 'POST', body);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const webhook = await mailchimpApiRequest.call(this, endpoint, 'POST', body);
|
||||
if (webhook.id === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user