mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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
@@ -115,7 +115,6 @@ export class PayPalTrigger implements INodeType {
|
||||
},
|
||||
|
||||
async create(this: IHookFunctions): Promise<boolean> {
|
||||
let webhook;
|
||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||
const events = this.getNodeParameter('events', []) as string[];
|
||||
const body = {
|
||||
@@ -125,11 +124,7 @@ export class PayPalTrigger implements INodeType {
|
||||
}),
|
||||
};
|
||||
const endpoint = '/notifications/webhooks';
|
||||
try {
|
||||
webhook = await payPalApiRequest.call(this, endpoint, 'POST', body);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const webhook = await payPalApiRequest.call(this, endpoint, 'POST', body);
|
||||
|
||||
if (webhook.id === undefined) {
|
||||
return false;
|
||||
@@ -156,7 +151,6 @@ export class PayPalTrigger implements INodeType {
|
||||
};
|
||||
|
||||
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
||||
let webhook;
|
||||
const webhookData = this.getWorkflowStaticData('node');
|
||||
const bodyData = this.getBodyData();
|
||||
const req = this.getRequestObject();
|
||||
@@ -188,11 +182,7 @@ export class PayPalTrigger implements INodeType {
|
||||
webhook_id: webhookData.webhookId,
|
||||
webhook_event: bodyData,
|
||||
};
|
||||
try {
|
||||
webhook = await payPalApiRequest.call(this, endpoint, 'POST', body);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const webhook = await payPalApiRequest.call(this, endpoint, 'POST', body);
|
||||
if (webhook.verification_status !== 'SUCCESS') {
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user