From d70d0410921c3acbbeeb20fd22332a1537733b93 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 09:03:23 +0300 Subject: [PATCH 1/6] prevent NodeApiError rewraping in request functions --- .../nodes/ActiveCampaign/GenericFunctions.ts | 1 + .../nodes/AcuityScheduling/GenericFunctions.ts | 1 + .../nodes/Affinity/GenericFunctions.ts | 1 + .../nodes/AgileCrm/GenericFunctions.ts | 2 ++ .../nodes/ApiTemplateIo/GenericFunctions.ts | 1 + .../nodes/Automizy/GenericFunctions.ts | 1 + .../nodes/Autopilot/GenericFunctions.ts | 1 + .../Aws/CertificateManager/GenericFunctions.ts | 1 + .../nodes/Aws/ELB/GenericFunctions.ts | 1 + .../nodes-base/nodes/Aws/SQS/AwsSqs.node.ts | 2 ++ .../nodes/Aws/Textract/GenericFunctions.ts | 1 + .../nodes/Aws/Transcribe/GenericFunctions.ts | 1 + .../nodes/Bannerbear/GenericFunctions.ts | 1 + .../nodes/Baserow/GenericFunctions.ts | 2 ++ .../nodes/Bitbucket/GenericFunctions.ts | 1 + .../nodes-base/nodes/Bitly/GenericFunctions.ts | 1 + .../nodes/Bitwarden/GenericFunctions.ts | 2 ++ .../nodes-base/nodes/Box/GenericFunctions.ts | 1 + .../nodes/Brandfetch/GenericFunctions.ts | 1 + .../nodes-base/nodes/Bubble/GenericFunctions.ts | 1 + .../nodes/Chargebee/Chargebee.node.ts | 1 + .../nodes/CircleCi/GenericFunctions.ts | 1 + .../nodes/Cisco/Webex/GenericFunctions.ts | 1 + .../nodes/Citrix/ADC/GenericFunctions.ts | 1 + .../nodes/Clearbit/GenericFunctions.ts | 1 + .../nodes/ClickUp/GenericFunctions.ts | 1 + .../nodes/Cloudflare/GenericFunctions.ts | 1 + .../nodes/Cockpit/GenericFunctions.ts | 1 + .../nodes-base/nodes/Coda/GenericFunctions.ts | 1 + .../nodes/CoinGecko/GenericFunctions.ts | 1 + .../nodes/Contentful/GenericFunctions.ts | 1 + .../nodes/ConvertKit/GenericFunctions.ts | 1 + .../nodes-base/nodes/Copper/GenericFunctions.ts | 1 + .../nodes-base/nodes/DeepL/GenericFunctions.ts | 1 + .../nodes-base/nodes/Demio/GenericFunctions.ts | 1 + .../nodes-base/nodes/Dhl/GenericFunctions.ts | 1 + .../nodes/Discourse/GenericFunctions.ts | 1 + .../nodes-base/nodes/Disqus/GenericFunctions.ts | 1 + .../nodes-base/nodes/Drift/GenericFunctions.ts | 1 + .../nodes/Dropbox/GenericFunctions.ts | 1 + .../nodes-base/nodes/Egoi/GenericFunctions.ts | 1 + .../Elastic/ElasticSecurity/GenericFunctions.ts | 1 + .../Elastic/Elasticsearch/GenericFunctions.ts | 2 ++ .../nodes/EmailSend/v2/send.operation.ts | 1 + .../nodes-base/nodes/Emelia/GenericFunctions.ts | 1 + .../nodes/Eventbrite/GenericFunctions.ts | 1 + .../nodes/Facebook/FacebookGraphApi.node.ts | 1 + .../nodes/Facebook/GenericFunctions.ts | 1 + .../nodes/FacebookLeadAds/GenericFunctions.ts | 3 +++ .../nodes-base/nodes/Figma/GenericFunctions.ts | 1 + .../nodes/FileMaker/GenericFunctions.ts | 1 + packages/nodes-base/nodes/Flow/Flow.node.ts | 3 +++ .../nodes-base/nodes/Flow/GenericFunctions.ts | 1 + .../nodes-base/nodes/FormIo/GenericFunctions.ts | 1 + .../nodes/Formstack/GenericFunctions.ts | 1 + .../nodes/Freshdesk/GenericFunctions.ts | 1 + .../nodes/Freshservice/GenericFunctions.ts | 1 + .../nodes/FreshworksCrm/GenericFunctions.ts | 1 + packages/nodes-base/nodes/Ftp/Ftp.node.ts | 2 ++ .../nodes/GetResponse/GenericFunctions.ts | 1 + .../nodes-base/nodes/Github/GenericFunctions.ts | 1 + .../nodes-base/nodes/Gitlab/GenericFunctions.ts | 1 + .../nodes/Gitlab/GitlabTrigger.node.ts | 1 + .../nodes/GoToWebinar/GenericFunctions.ts | 1 + .../Google/BigQuery/v1/GenericFunctions.ts | 1 + .../nodes/Google/Books/GenericFunctions.ts | 1 + .../nodes/Google/Calendar/GenericFunctions.ts | 1 + .../nodes/Google/Chat/GenericFunctions.ts | 1 + .../CloudNaturalLanguage/GenericFunctions.ts | 1 + .../nodes/Google/Contacts/GenericFunctions.ts | 1 + .../nodes/Google/Docs/GenericFunctions.ts | 1 + .../nodes/Google/Drive/v1/GenericFunctions.ts | 1 + .../nodes/Google/Drive/v2/transport/index.ts | 1 + .../Firebase/CloudFirestore/GenericFunctions.ts | 1 + .../RealtimeDatabase/GenericFunctions.ts | 1 + .../Google/GSuiteAdmin/GenericFunctions.ts | 1 + .../Google/Perspective/GenericFunctions.ts | 1 + .../nodes/Google/Sheet/v1/GenericFunctions.ts | 1 + .../nodes/Google/Sheet/v2/transport/index.ts | 1 + .../nodes/Google/Slides/GenericFunctions.ts | 1 + .../nodes/Google/Task/GenericFunctions.ts | 1 + .../nodes/Google/Translate/GenericFunctions.ts | 1 + .../nodes/Google/YouTube/GenericFunctions.ts | 1 + .../nodes-base/nodes/Gotify/GenericFunctions.ts | 1 + .../nodes/Grafana/GenericFunctions.ts | 1 + .../nodes-base/nodes/Grist/GenericFunctions.ts | 1 + .../nodes/Gumroad/GenericFunctions.ts | 1 + .../nodes/HackerNews/GenericFunctions.ts | 1 + .../nodes/HaloPSA/GenericFunctions.ts | 2 ++ .../nodes/Harvest/GenericFunctions.ts | 1 + .../nodes/HelpScout/GenericFunctions.ts | 1 + .../nodes/HomeAssistant/GenericFunctions.ts | 1 + .../nodes/Hubspot/V1/GenericFunctions.ts | 1 + .../nodes/Hubspot/V2/GenericFunctions.ts | 1 + .../nodes/HumanticAI/GenericFunctions.ts | 1 + .../nodes-base/nodes/Hunter/GenericFunctions.ts | 1 + .../nodes/Intercom/GenericFunctions.ts | 1 + .../nodes-base/nodes/Intercom/Intercom.node.ts | 8 ++++++++ .../nodes/InvoiceNinja/GenericFunctions.ts | 1 + .../nodes/Iterable/GenericFunctions.ts | 1 + .../nodes/Jenkins/GenericFunctions.ts | 1 + .../nodes-base/nodes/Jenkins/Jenkins.node.ts | 3 +++ .../nodes/JotForm/GenericFunctions.ts | 1 + .../nodes-base/nodes/Keap/GenericFunctions.ts | 1 + .../nodes-base/nodes/Line/GenericFunctions.ts | 1 + .../nodes-base/nodes/Linear/GenericFunctions.ts | 1 + .../nodes/LingvaNex/GenericFunctions.ts | 1 + .../nodes/LinkedIn/GenericFunctions.ts | 1 + .../nodes/Magento/GenericFunctions.ts | 1 + .../nodes/Mailchimp/GenericFunctions.ts | 1 + .../nodes/Mailchimp/MailchimpTrigger.node.ts | 1 + .../nodes/MailerLite/GenericFunctions.ts | 1 + .../nodes-base/nodes/Mailgun/Mailgun.node.ts | 1 + .../nodes/Mandrill/GenericFunctions.ts | 1 + .../nodes-base/nodes/Mandrill/Mandrill.node.ts | 1 + .../nodes/Marketstack/GenericFunctions.ts | 1 + .../nodes-base/nodes/Matrix/GenericFunctions.ts | 1 + .../nodes-base/nodes/Mautic/GenericFunctions.ts | 1 + .../nodes-base/nodes/Medium/GenericFunctions.ts | 1 + .../nodes/MessageBird/GenericFunctions.ts | 1 + .../Microsoft/Dynamics/GenericFunctions.ts | 1 + .../Microsoft/Excel/v1/GenericFunctions.ts | 1 + .../nodes/Microsoft/Excel/v2/transport/index.ts | 1 + .../Microsoft/GraphSecurity/GenericFunctions.ts | 1 + .../Microsoft/OneDrive/GenericFunctions.ts | 1 + .../Microsoft/Outlook/v1/GenericFunctions.ts | 1 + .../Microsoft/Teams/v1/GenericFunctions.ts | 1 + .../nodes/Microsoft/ToDo/GenericFunctions.ts | 1 + .../nodes-base/nodes/Mindee/GenericFunctions.ts | 1 + .../nodes-base/nodes/Misp/GenericFunctions.ts | 1 + .../nodes-base/nodes/Mocean/GenericFunctions.ts | 1 + .../nodes/MondayCom/GenericFunctions.ts | 1 + .../nodes/MonicaCrm/GenericFunctions.ts | 1 + .../nodes-base/nodes/Msg91/GenericFunctions.ts | 1 + .../nodes-base/nodes/N8n/GenericFunctions.ts | 1 + .../nodes-base/nodes/Nasa/GenericFunctions.ts | 1 + .../nodes/Netlify/GenericFunctions.ts | 1 + packages/nodes-base/nodes/NocoDB/NocoDB.node.ts | 3 +++ .../nodes/Notion/shared/GenericFunctions.ts | 1 + .../nodes-base/nodes/Odoo/GenericFunctions.ts | 9 +++++++++ .../nodes/OneSimpleApi/GenericFunctions.ts | 1 + .../nodes/Onfleet/GenericFunctions.ts | 1 + .../nodes/OpenThesaurus/GenericFunctions.ts | 1 + .../nodes/OpenWeatherMap/OpenWeatherMap.node.ts | 1 + .../nodes-base/nodes/Orbit/GenericFunctions.ts | 1 + .../nodes-base/nodes/Oura/GenericFunctions.ts | 1 + .../nodes-base/nodes/Paddle/GenericFunctions.ts | 1 + .../nodes/PagerDuty/GenericFunctions.ts | 1 + .../nodes-base/nodes/PayPal/GenericFunctions.ts | 1 + .../nodes/PayPal/PayPalTrigger.node.ts | 2 ++ .../nodes/Phantombuster/GenericFunctions.ts | 1 + .../nodes/PhilipsHue/GenericFunctions.ts | 1 + .../nodes/Pipedrive/GenericFunctions.ts | 1 + .../nodes-base/nodes/Plivo/GenericFunctions.ts | 1 + .../nodes/PostHog/GenericFunctions.ts | 1 + .../nodes/Postmark/GenericFunctions.ts | 1 + .../nodes/ProfitWell/GenericFunctions.ts | 1 + .../nodes/Pushbullet/GenericFunctions.ts | 1 + .../nodes/Pushcut/GenericFunctions.ts | 1 + .../nodes/Pushover/GenericFunctions.ts | 1 + .../nodes/QuickBase/GenericFunctions.ts | 1 + .../nodes/QuickBooks/GenericFunctions.ts | 1 + .../nodes/Raindrop/GenericFunctions.ts | 1 + .../nodes-base/nodes/Reddit/GenericFunctions.ts | 2 ++ .../nodes-base/nodes/S3/GenericFunctions.ts | 1 + packages/nodes-base/nodes/S3/S3.node.ts | 1 + .../nodes/Salesforce/GenericFunctions.ts | 1 + .../nodes/Salesforce/Salesforce.node.ts | 17 +++++++++++++++++ .../nodes/Salesforce/SalesforceTrigger.node.ts | 1 + .../nodes/Salesmate/GenericFunctions.ts | 1 + .../nodes/SeaTable/GenericFunctions.ts | 1 + .../nodes/SecurityScorecard/GenericFunctions.ts | 1 + .../nodes-base/nodes/Sendy/GenericFunctions.ts | 1 + .../nodes/SentryIo/GenericFunctions.ts | 1 + .../nodes/ServiceNow/GenericFunctions.ts | 1 + .../nodes-base/nodes/Signl4/GenericFunctions.ts | 1 + .../nodes/Slack/V1/GenericFunctions.ts | 1 + .../nodes-base/nodes/Splunk/GenericFunctions.ts | 1 + .../nodes/Spontit/GenericFunctions.ts | 1 + .../nodes/Spotify/GenericFunctions.ts | 1 + .../nodes-base/nodes/Stackby/GenericFunction.ts | 1 + .../nodes/Storyblok/GenericFunctions.ts | 1 + .../nodes-base/nodes/Strapi/GenericFunctions.ts | 1 + .../nodes-base/nodes/Strava/GenericFunctions.ts | 1 + .../nodes/Supabase/GenericFunctions.ts | 1 + .../nodes/SurveyMonkey/GenericFunctions.ts | 1 + .../nodes/SyncroMSP/v1/transport/index.ts | 1 + .../nodes-base/nodes/Taiga/GenericFunctions.ts | 2 ++ .../nodes/Tapfiliate/GenericFunctions.ts | 1 + .../nodes/Telegram/GenericFunctions.ts | 1 + .../nodes/Todoist/GenericFunctions.ts | 2 ++ .../nodes-base/nodes/Toggl/GenericFunctions.ts | 1 + .../nodes-base/nodes/Toggl/TogglTrigger.node.ts | 1 + .../nodes/TravisCi/GenericFunctions.ts | 1 + .../nodes-base/nodes/Twist/GenericFunctions.ts | 1 + .../nodes/Twitter/V1/GenericFunctions.ts | 1 + .../nodes/Twitter/V2/GenericFunctions.ts | 1 + .../nodes/Typeform/GenericFunctions.ts | 1 + .../nodes/UnleashedSoftware/GenericFunctions.ts | 1 + .../nodes-base/nodes/Uplead/GenericFunctions.ts | 1 + .../nodes/UptimeRobot/GenericFunctions.ts | 1 + .../Venafi/ProtectCloud/GenericFunctions.ts | 1 + .../nodes-base/nodes/Vero/GenericFunctions.ts | 1 + packages/nodes-base/nodes/Vero/Vero.node.ts | 5 +++++ .../nodes-base/nodes/Vonage/GenericFunctions.ts | 1 + .../nodes/WhatsApp/GenericFunctions.ts | 2 ++ .../nodes-base/nodes/Wise/GenericFunctions.ts | 1 + .../nodes/Wordpress/GenericFunctions.ts | 1 + .../nodes/Workable/GenericFunctions.ts | 1 + .../nodes-base/nodes/Xero/GenericFunctions.ts | 1 + .../nodes-base/nodes/Yourls/GenericFunctions.ts | 1 + .../nodes-base/nodes/Zammad/GenericFunctions.ts | 1 + .../nodes-base/nodes/Zendesk/Zendesk.node.ts | 1 + .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 + .../nodes-base/nodes/Zulip/GenericFunctions.ts | 1 + 215 files changed, 270 insertions(+) diff --git a/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts b/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts index 8aa041c3d4a7e..dd0562a706152 100644 --- a/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts @@ -63,6 +63,7 @@ export async function activeCampaignApiRequest( return responseData[dataKey] as IDataObject; } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts index ae68762998b78..2ca12b0b396e4 100644 --- a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts @@ -54,6 +54,7 @@ export async function acuitySchedulingApiRequest( ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts index 54ece184d5930..1365edc349084 100644 --- a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function affinityApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts index f308b94c90bc0..014cb5632a39b 100644 --- a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts @@ -50,6 +50,7 @@ export async function agileCrmApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -168,6 +169,7 @@ export async function agileCrmApiRequestUpdate( return lastSuccesfulUpdateReturn; } catch (error) { if (successfulUpdates.length === 0) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } else { throw new NodeApiError(this.getNode(), error as JsonObject, { diff --git a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts index e099412bca88a..e93d5fe2e699e 100644 --- a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts @@ -47,6 +47,7 @@ export async function apiTemplateIoApiRequest( } return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Automizy/GenericFunctions.ts b/packages/nodes-base/nodes/Automizy/GenericFunctions.ts index 0e92d09333fc0..ae0d501a2c317 100644 --- a/packages/nodes-base/nodes/Automizy/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Automizy/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function automizyApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts index f6387d27e9fa5..11915ce14aaf3 100644 --- a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function autopilotApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts index bff183fcee42e..03e93ac2f2aad 100644 --- a/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function awsApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts index 51a88f61bafb0..63686df49e2aa 100644 --- a/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function awsApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts index bfd9d7fc1dc99..ee7f75795e725 100644 --- a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts +++ b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts @@ -253,6 +253,7 @@ export class AwsSqs implements INodeType { // loads first 1000 queues from SQS data = await awsApiRequestSOAP.call(this, 'sqs', 'GET', `?${params.join('&')}`); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } @@ -372,6 +373,7 @@ export class AwsSqs implements INodeType { `${queuePath}?${params.join('&')}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts index 663c82b54e3db..ecf52094f3648 100644 --- a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts @@ -70,6 +70,7 @@ export async function awsApiRequest( } } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); // no XML parsing needed } } diff --git a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts index 05faeb8a83ec6..cc44ba37dff6d 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts @@ -68,6 +68,7 @@ export async function awsApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); // no XML parsing needed } } diff --git a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts index 0e48b58d83a9f..c28be9818da14 100644 --- a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function bannerbearApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts index 8e30c5c1482b6..2023c61c84366 100644 --- a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function baserowApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -104,6 +105,7 @@ export async function getJwtToken( const { token } = (await this.helpers.request(options)) as { token: string }; return token; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts index 3281757d07acd..838a403fd5627 100644 --- a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function bitbucketApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts index daadfdd508562..c718bb3d92535 100644 --- a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function bitlyApiRequest( }); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index 0bb12eac99e35..2fc65974e2874 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -65,6 +65,7 @@ export async function bitwardenApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -99,6 +100,7 @@ export async function getAccessToken( const { access_token } = await this.helpers.request(options); return access_token; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Box/GenericFunctions.ts b/packages/nodes-base/nodes/Box/GenericFunctions.ts index f768a217656b7..2f028270350fa 100644 --- a/packages/nodes-base/nodes/Box/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Box/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function boxApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'boxOAuth2Api', options, oAuth2Options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts index 6a18a4579fc4b..59ffb0c8a90af 100644 --- a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts @@ -53,6 +53,7 @@ export async function brandfetchApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts index 46927492e96b6..6ec4ca17f434d 100644 --- a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function bubbleApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts b/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts index 5db36b4bcbaa0..d518edaa247f0 100644 --- a/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts +++ b/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts @@ -598,6 +598,7 @@ export class Chargebee implements INodeType { try { responseData = await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts index 370981bebe607..e5ea96141219b 100644 --- a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function circleciApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 88d20374308b0..2e852fe302d71 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -48,6 +48,7 @@ export async function webexApiRequest( tokenType: 'Bearer', }); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts index 4b9e0ea9b5e28..d21d34e2a949f 100644 --- a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function citrixADCApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts index 95a45b65afb2f..f6888436410ff 100644 --- a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function clearbitApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts index 21974d6a08293..bbf53dde69aba 100644 --- a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts @@ -51,6 +51,7 @@ export async function clickupApiRequest( ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts index 3c6fc5c4163c4..9ae7db065cb86 100644 --- a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function cloudflareApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'cloudflareApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts index f6b30fb9caac9..06a3c5f22f965 100644 --- a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function cockpitApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Coda/GenericFunctions.ts b/packages/nodes-base/nodes/Coda/GenericFunctions.ts index b889e7dafa063..4f5179cd0c2b7 100644 --- a/packages/nodes-base/nodes/Coda/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Coda/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function codaApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts index 141ed62851816..cbfcb3f66868a 100644 --- a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function coinGeckoApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts index 270aadc44880d..e238d5aae4abd 100644 --- a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function contentfulApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts index 68569e4c8694f..2b3b023998323 100644 --- a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts @@ -52,6 +52,7 @@ export async function convertKitApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Copper/GenericFunctions.ts b/packages/nodes-base/nodes/Copper/GenericFunctions.ts index 2ffd1ca7cf675..c0af415d214a8 100644 --- a/packages/nodes-base/nodes/Copper/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Copper/GenericFunctions.ts @@ -64,6 +64,7 @@ export async function copperApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts index 649096fc00661..2e9b63bc776d1 100644 --- a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts +++ b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function deepLApiRequest( return await this.helpers.requestWithAuthentication.call(this, 'deepLApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Demio/GenericFunctions.ts b/packages/nodes-base/nodes/Demio/GenericFunctions.ts index 17c113be7fad8..2de67312d8b6c 100644 --- a/packages/nodes-base/nodes/Demio/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Demio/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function demioApiRequest( return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts index 1a062fb12a3c4..33339b6ceee7e 100644 --- a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function dhlApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Discourse/GenericFunctions.ts b/packages/nodes-base/nodes/Discourse/GenericFunctions.ts index 8a66a6296debf..83b4e17bb8a44 100644 --- a/packages/nodes-base/nodes/Discourse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Discourse/GenericFunctions.ts @@ -33,6 +33,7 @@ export async function discourseApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'discourseApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts index 8d03fe04075ef..aa23c908c8ef1 100644 --- a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function disqusApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index 44bfb8c2a7e50..9352a6154cba2 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -50,6 +50,7 @@ export async function driftApiRequest( return await this.helpers.requestOAuth2.call(this, 'driftOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts index 86e9d655699d8..14be971daeb44 100644 --- a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function dropboxApiRequest( return await this.helpers.requestOAuth2.call(this, 'dropboxOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts index a20e5e87613d2..aa951ecc10079 100644 --- a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function egoiApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts index 696170cff1af3..aea4720439ce9 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts @@ -58,6 +58,7 @@ export async function elasticSecurityApiRequest( error.error.error = `${error.error.error}: ${error.error.message}`; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts index ed013079f8cc6..054450d8238dd 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function elasticsearchApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'elasticsearchApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -103,6 +104,7 @@ export async function elasticsearchApiRequestAllItems( return returnData; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts index 8e9623c67d3dc..e289634e6ae91 100644 --- a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts +++ b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts @@ -336,6 +336,7 @@ export async function execute(this: IExecuteFunctions): Promise (a.name > b.name ? 0 : 1)); return items; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Flow/Flow.node.ts b/packages/nodes-base/nodes/Flow/Flow.node.ts index c39a37d7987d4..6c27419a1fd98 100644 --- a/packages/nodes-base/nodes/Flow/Flow.node.ts +++ b/packages/nodes-base/nodes/Flow/Flow.node.ts @@ -125,6 +125,7 @@ export class Flow implements INodeType { responseData = await flowApiRequest.call(this, 'POST', '/tasks', body); responseData = responseData.task; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -193,6 +194,7 @@ export class Flow implements INodeType { responseData = await flowApiRequest.call(this, 'PUT', `/tasks/${taskId}`, body); responseData = responseData.task; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -207,6 +209,7 @@ export class Flow implements INodeType { try { responseData = await flowApiRequest.call(this, 'GET', `/tasks/${taskId}`, {}, qs); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Flow/GenericFunctions.ts b/packages/nodes-base/nodes/Flow/GenericFunctions.ts index 0f304e64150ef..3b5fa67a6197c 100644 --- a/packages/nodes-base/nodes/Flow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Flow/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function flowApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts index 52dfbf944e323..856e80149254b 100644 --- a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts @@ -82,6 +82,7 @@ export async function formIoApiRequest( try { return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts index fe53058349a22..81229703fd651 100644 --- a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts @@ -81,6 +81,7 @@ export async function apiRequest( return await this.helpers.requestOAuth2.call(this, 'formstackOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts index 59578dfea3e62..6296ceae37afc 100644 --- a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function freshdeskApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts index 558a34c125ab9..ad4146efc7480 100644 --- a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts @@ -69,6 +69,7 @@ export async function freshserviceApiRequest( } } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts b/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts index 5bcdafc5aeccb..f0f64c7faddd0 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function freshworksCrmApiRequest( const credentialsType = 'freshworksCrmApi'; return await this.helpers.requestWithAuthentication.call(this, credentialsType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Ftp/Ftp.node.ts b/packages/nodes-base/nodes/Ftp/Ftp.node.ts index 850c9eae54402..e0c9ddce8cbbf 100644 --- a/packages/nodes-base/nodes/Ftp/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp/Ftp.node.ts @@ -786,6 +786,7 @@ export class Ftp implements INodeType { await ftp!.mkdir(dirPath, true); await ftp!.put(uploadData, remotePath); } else { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -803,6 +804,7 @@ export class Ftp implements INodeType { await ftp!.mkdir(dirPath, true); await ftp!.put(buffer, remotePath); } else { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts index 1271dea98ca07..27c2b83f3907c 100644 --- a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function getresponseApiRequest( return await this.helpers.requestOAuth2.call(this, 'getResponseOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Github/GenericFunctions.ts b/packages/nodes-base/nodes/Github/GenericFunctions.ts index a27618b3dbdb2..1dd0e5e35feb9 100644 --- a/packages/nodes-base/nodes/Github/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Github/GenericFunctions.ts @@ -60,6 +60,7 @@ export async function githubApiRequest( return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts index c898041b541b8..17c1042f3a1e8 100644 --- a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts @@ -51,6 +51,7 @@ export async function gitlabApiRequest( return await this.helpers.requestOAuth2.call(this, 'gitlabOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts index 12febc14e5205..f5e7bd06c091b 100644 --- a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts +++ b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts @@ -250,6 +250,7 @@ export class GitlabTrigger implements INodeType { try { responseData = await gitlabApiRequest.call(this, 'POST', endpoint, body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts index 4d85e51375b4c..cddd4465bc22e 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts @@ -77,6 +77,7 @@ export async function goToWebinarApiRequest( // https://stackoverflow.com/questions/62190724/getting-gotowebinar-registrant return losslessJSON.parse(response as string, convertLosslessNumber); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts index d4456f318b2ca..792aad2756b47 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts @@ -61,6 +61,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index ab8d73f58e576..bd21ca1a2b27e 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -60,6 +60,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts index 819e67cd4665d..8c143df716bd8 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts index 442ba4799d581..52e2f54efc72e 100644 --- a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts @@ -57,6 +57,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } if (Object.keys(responseData as IDataObject).length !== 0) { diff --git a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts index 58cb39c8b0b08..c4f53b02f55ee 100644 --- a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function googleApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts index 6c07a1a0daedb..664926b8ec558 100644 --- a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleContactsOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts index 02183796d3d2a..ac91a6414711d 100644 --- a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts @@ -50,6 +50,7 @@ export async function googleApiRequest( return await this.helpers.requestOAuth2.call(this, 'googleDocsOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts index 16171fb75f421..e4f70891388b3 100644 --- a/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts @@ -59,6 +59,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts index b0d984f529b38..b91e879c8f7f3 100644 --- a/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts @@ -63,6 +63,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts index 328fa246feca2..0c329df17b45d 100644 --- a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function googleApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts index fb19c1d4d893c..9df7c2475bbc2 100644 --- a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts @@ -48,6 +48,7 @@ export async function googleApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts index 7f30fe6812e29..81efddee03af2 100644 --- a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'gSuiteAdminOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts index fdc1b043f598f..261275c79e92c 100644 --- a/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts @@ -25,6 +25,7 @@ export async function googleApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'googlePerspectiveOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index 540367aabd085..d3ecfd5364864 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -64,6 +64,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts index d3fe3e07620c8..7d38360c723d8 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts @@ -74,6 +74,7 @@ export async function apiRequest( throw error; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts index 98cbb28ecd06c..064e7479692ce 100644 --- a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts @@ -56,6 +56,7 @@ export async function googleApiRequest( error.statusCode = '401'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts index c0e69151e4aa0..a40d305eedc3e 100644 --- a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleTasksOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts index d85912801a720..17812d70cf5f0 100644 --- a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function googleApiRequest( return await this.helpers.requestOAuth2.call(this, 'googleTranslateOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts index acd718c1b2b19..ad80130852578 100644 --- a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'youTubeOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts index 8aa00f4ace6c3..61541c7252314 100644 --- a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function gotifyApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Grafana/GenericFunctions.ts b/packages/nodes-base/nodes/Grafana/GenericFunctions.ts index 9fb11f7c0ec72..c64b69a168c3a 100644 --- a/packages/nodes-base/nodes/Grafana/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Grafana/GenericFunctions.ts @@ -72,6 +72,7 @@ export async function grafanaApiRequest( 'Invalid credentials or error in establishing connection with given credentials'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Grist/GenericFunctions.ts b/packages/nodes-base/nodes/Grist/GenericFunctions.ts index 07a4505d35eda..cc0cf76a9174d 100644 --- a/packages/nodes-base/nodes/Grist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Grist/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function gristApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts index 8c4e810e670a3..028b4884091f9 100644 --- a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function gumroadApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts index 414ce7a2797f5..f30c092e6e4d2 100644 --- a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts @@ -29,6 +29,7 @@ export async function hackerNewsApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts index f6ac15258d756..e2040dd6b70cf 100644 --- a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts @@ -54,6 +54,7 @@ export async function getAccessTokens( const tokens = await this.helpers.request(options); return tokens; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -112,6 +113,7 @@ export async function haloPSAApiRequest( .toLowerCase()}.`; } } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts index 66c1865650f8d..2081c8e655ea9 100644 --- a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function harvestApiRequest( return await this.helpers.requestOAuth2.call(this, 'harvestOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts index 6ad5fbdbc71e0..9e4d5de948010 100644 --- a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function helpscoutApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'helpScoutOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts index 58194341bcb7a..d1202de84bd4d 100644 --- a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function homeAssistantApiRequest( return await this.helpers.request(options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts index 9fa600730d182..3b99e0312f795 100644 --- a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts @@ -68,6 +68,7 @@ export async function hubspotApiRequest( }); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts index c5b255ab6c386..9461cfa26f3d0 100644 --- a/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts @@ -60,6 +60,7 @@ export async function hubspotApiRequest( }); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts index bd0479e0f0554..7b8a3c39a6093 100644 --- a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function humanticAiApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts index d78a2d204a3f5..473fa0164ee90 100644 --- a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function hunterApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts index 6ebbfd0642ec4..69e9b514d3acf 100644 --- a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function intercomApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Intercom/Intercom.node.ts b/packages/nodes-base/nodes/Intercom/Intercom.node.ts index ba16a6422726a..dbeb47432d813 100644 --- a/packages/nodes-base/nodes/Intercom/Intercom.node.ts +++ b/packages/nodes-base/nodes/Intercom/Intercom.node.ts @@ -83,6 +83,7 @@ export class Intercom implements INodeType { try { response = await intercomApiRequest.call(this, '/companies', 'GET'); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } const companies = response.companies; @@ -202,6 +203,7 @@ export class Intercom implements INodeType { try { responseData = await intercomApiRequest.call(this, '/contacts', 'POST', body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -225,6 +227,7 @@ export class Intercom implements INodeType { responseData = responseData.contacts; } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -249,6 +252,7 @@ export class Intercom implements INodeType { responseData = responseData.contacts; } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -263,6 +267,7 @@ export class Intercom implements INodeType { responseData = await intercomApiRequest.call(this, '/contacts', 'DELETE', {}, qs); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -378,6 +383,7 @@ export class Intercom implements INodeType { try { responseData = await intercomApiRequest.call(this, '/users', 'POST', body, qs); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -400,6 +406,7 @@ export class Intercom implements INodeType { responseData = await intercomApiRequest.call(this, '/users', 'GET', {}, qs); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -424,6 +431,7 @@ export class Intercom implements INodeType { responseData = responseData.users; } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts index 76750e8fd9f2b..3d0243fa12317 100644 --- a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts +++ b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function invoiceNinjaApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'invoiceNinjaApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts index 7ecc3cae029fd..2eb9590fa2a89 100644 --- a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function iterableApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts index 16bfe735b94b0..23e3c10ab6cc9 100644 --- a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function jenkinsApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts index 5ba983f2e5a09..866ffe98c6983 100644 --- a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts +++ b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts @@ -538,6 +538,7 @@ export class Jenkins implements INodeType { if (error.httpCode === '302') { responseData = { success: true }; } else { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -590,6 +591,7 @@ export class Jenkins implements INodeType { if (error.httpCode === '503') { responseData = { success: true }; } else { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -602,6 +604,7 @@ export class Jenkins implements INodeType { if (error.httpCode === '503') { responseData = { success: true }; } else { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts index bd6292840dc90..1905fbbbeb963 100644 --- a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function jotformApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Keap/GenericFunctions.ts b/packages/nodes-base/nodes/Keap/GenericFunctions.ts index 896c4449a9c45..b2626639fe349 100644 --- a/packages/nodes-base/nodes/Keap/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Keap/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function keapApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'keapOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Line/GenericFunctions.ts b/packages/nodes-base/nodes/Line/GenericFunctions.ts index 01ffb695062f5..b37e59e9612d8 100644 --- a/packages/nodes-base/nodes/Line/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Line/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function lineApiRequest( tokenType: 'Bearer', }); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Linear/GenericFunctions.ts b/packages/nodes-base/nodes/Linear/GenericFunctions.ts index 4d008f2ac5d87..41d045f0577c4 100644 --- a/packages/nodes-base/nodes/Linear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Linear/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function linearApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts index ef41a8806154e..f809f61e33b1d 100644 --- a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts @@ -42,6 +42,7 @@ export async function lingvaNexApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts index 45c941b3edd44..85f14317f96fe 100644 --- a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts @@ -68,6 +68,7 @@ export async function linkedInApiRequest( }), ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Magento/GenericFunctions.ts b/packages/nodes-base/nodes/Magento/GenericFunctions.ts index f4255a3194155..6a3def5c99ac7 100644 --- a/packages/nodes-base/nodes/Magento/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Magento/GenericFunctions.ts @@ -42,6 +42,7 @@ export async function magentoApiRequest( //@ts-ignore return await this.helpers.requestWithAuthentication.call(this, 'magento2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 3c9627ef7d35d..9a03740bdb7a0 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -77,6 +77,7 @@ export async function mailchimpApiRequest( }); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts index e2edbe41e0574..a351e58e82ead 100644 --- a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts @@ -207,6 +207,7 @@ export class MailchimpTrigger implements INodeType { } throw error; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } return true; diff --git a/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts b/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts index 2459f349d1279..fb36108a58fb8 100644 --- a/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function mailerliteApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts index 24e151d349154..81739ac74b01d 100644 --- a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts +++ b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts @@ -184,6 +184,7 @@ export class Mailgun implements INodeType { options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts index b2b08ce01a0a0..14f0bb30fc66f 100644 --- a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function mandrillApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts index ab740ed87dafd..da58b7ee17440 100644 --- a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts +++ b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts @@ -692,6 +692,7 @@ export class Mandrill implements INodeType { try { templates = await mandrillApiRequest.call(this, '/templates', 'POST', '/list'); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } for (const template of templates) { diff --git a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts index 6e8511967a61f..e092fca9e6094 100644 --- a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts @@ -34,6 +34,7 @@ export async function marketstackApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index 112db518da881..971ded9778c1c 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -51,6 +51,7 @@ export async function matrixApiRequest( //@ts-ignore return options.overridePrefix === 'media' ? JSON.parse(response as string) : response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts index 415c70afc0f07..4683183555b8d 100644 --- a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts @@ -57,6 +57,7 @@ export async function mauticApiRequest( return returnData; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Medium/GenericFunctions.ts b/packages/nodes-base/nodes/Medium/GenericFunctions.ts index 5952c07485b63..912f7e2eba3dc 100644 --- a/packages/nodes-base/nodes/Medium/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Medium/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function mediumApiRequest( return await this.helpers.requestOAuth2.call(this, 'mediumOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts index b8183d08c3c73..9e542098c31ee 100644 --- a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function messageBirdApiRequest( } return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts index c4ec69687855f..a066c9f870d7f 100644 --- a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts @@ -47,6 +47,7 @@ export async function microsoftApiRequest( property: 'id_token', }); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts index de358224381a1..95ff134ca48f9 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function microsoftApiRequest( return await this.helpers.requestOAuth2.call(this, 'microsoftExcelOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts b/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts index 61d0c4b1c4ac4..749b6d743b93d 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts @@ -33,6 +33,7 @@ export async function microsoftApiRequest( } return await this.helpers.requestOAuth2.call(this, 'microsoftExcelOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts index dbc1c40661f6b..6d6d534b83c3e 100644 --- a/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts @@ -69,6 +69,7 @@ export async function msGraphSecurityApiRequest( ' - Please check that your query parameter syntax is correct: https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts index b709cb0e685fc..6e1cd257a2d4d 100644 --- a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftOneDriveOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts index 17d175a46b791..e156b74014e21 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts @@ -50,6 +50,7 @@ export async function microsoftApiRequest( return await this.helpers.requestOAuth2.call(this, 'microsoftOutlookOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts index 0449ead6cb947..68627d65707ad 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftTeamsOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts index 4f5e4deb71302..d5350e0e130ba 100644 --- a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mindee/GenericFunctions.ts b/packages/nodes-base/nodes/Mindee/GenericFunctions.ts index 35b5e19742db3..d22e957b635a2 100644 --- a/packages/nodes-base/nodes/Mindee/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mindee/GenericFunctions.ts @@ -54,6 +54,7 @@ export async function mindeeApiRequest( return await this.helpers.requestWithAuthentication.call(this, service, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Misp/GenericFunctions.ts b/packages/nodes-base/nodes/Misp/GenericFunctions.ts index bdf59bda34e08..322d23555deda 100644 --- a/packages/nodes-base/nodes/Misp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Misp/GenericFunctions.ts @@ -63,6 +63,7 @@ export async function mispApiRequest( } } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mocean/GenericFunctions.ts b/packages/nodes-base/nodes/Mocean/GenericFunctions.ts index b6ef63be09a51..f41641111930d 100644 --- a/packages/nodes-base/nodes/Mocean/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mocean/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function moceanApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts index ff993c7d1c6ca..7e8f679635798 100644 --- a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function mondayComApiRequest( } return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts index e8f9e66778a91..168a6fb7437f3 100644 --- a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function monicaCrmApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Msg91/GenericFunctions.ts b/packages/nodes-base/nodes/Msg91/GenericFunctions.ts index 35ef4e00ac5dc..0dc01d82dbc42 100644 --- a/packages/nodes-base/nodes/Msg91/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Msg91/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function msg91ApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/N8n/GenericFunctions.ts b/packages/nodes-base/nodes/N8n/GenericFunctions.ts index e190d8abb0406..12ff8a142044a 100644 --- a/packages/nodes-base/nodes/N8n/GenericFunctions.ts +++ b/packages/nodes-base/nodes/N8n/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function apiRequest( if (error instanceof NodeApiError) { throw error; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts index 0b69c55a6f77d..8dd36ae48dfa5 100644 --- a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts @@ -34,6 +34,7 @@ export async function nasaApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts index 1c17f44b308b5..1b8d69a966ffd 100644 --- a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts @@ -45,6 +45,7 @@ export async function netlifyApiRequest( return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts index bfe3f4c090e6e..4a12ebbafcd58 100644 --- a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts +++ b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts @@ -399,6 +399,7 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -462,6 +463,7 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -753,6 +755,7 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts index 9ae5e52848237..0090118f57cd9 100644 --- a/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts @@ -76,6 +76,7 @@ export async function notionApiRequest( } return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts index 53634b6438a02..22c84492e0861 100644 --- a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts @@ -129,6 +129,7 @@ export async function odooJSONRPCRequest( } return responce.result; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -164,6 +165,7 @@ export async function odooGetModelFields( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -200,6 +202,7 @@ export async function odooCreate( const result = await odooJSONRPCRequest.call(this, body, url); return { id: result }; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -244,6 +247,7 @@ export async function odooGet( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -285,6 +289,7 @@ export async function odooGetAll( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -335,6 +340,7 @@ export async function odooUpdate( await odooJSONRPCRequest.call(this, body, url); return { id: itemsID }; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -377,6 +383,7 @@ export async function odooDelete( await odooJSONRPCRequest.call(this, body, url); return { success: true }; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -402,6 +409,7 @@ export async function odooGetUserID( const loginResult = await odooJSONRPCRequest.call(this, body, url); return loginResult as unknown as number; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -424,6 +432,7 @@ export async function odooGetServerVersion( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts index f8efd5ddc11e3..df06408033f1e 100644 --- a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function oneSimpleApiRequest( const responseData = await this.helpers.request(options); return responseData; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts index 87c1b0be28fd3..a7e29807448fa 100644 --- a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function onfleetApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts index 33b7906adf44c..74fd12b3b2fe7 100644 --- a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function openThesaurusApiRequest( return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts b/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts index f1f40ffc32990..23005f1150736 100644 --- a/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts +++ b/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts @@ -270,6 +270,7 @@ export class OpenWeatherMap implements INodeType { try { responseData = await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts index 7759f248efb16..f76edc1d1b807 100644 --- a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function orbitApiRequest( return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Oura/GenericFunctions.ts b/packages/nodes-base/nodes/Oura/GenericFunctions.ts index 9fb9691822004..6e38704cdb74a 100644 --- a/packages/nodes-base/nodes/Oura/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Oura/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function ouraApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts index ea6808cf1ca29..3b3e3f04974f6 100644 --- a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function paddleApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index 3206e205871d0..1dfdd8b5f689d 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -58,6 +58,7 @@ export async function pagerDutyApiRequest( return await this.helpers.requestOAuth2.call(this, 'pagerDutyOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts index 60f597cbe8107..f814910cdb624 100644 --- a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts @@ -72,6 +72,7 @@ export async function payPalApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts b/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts index 309c6d519340c..3e90e53d54b24 100644 --- a/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts +++ b/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts @@ -73,6 +73,7 @@ export class PayPalTrigger implements INodeType { const endpoint = '/notifications/webhooks-event-types'; events = await payPalApiRequest.call(this, endpoint, 'GET'); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } for (const event of events.event_types) { @@ -108,6 +109,7 @@ export class PayPalTrigger implements INodeType { delete webhookData.webhookId; return false; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } return true; diff --git a/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts b/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts index 35abf9dde46d4..a137540368264 100644 --- a/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts @@ -31,6 +31,7 @@ export async function phantombusterApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'phantombusterApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts index 2e739fb536b81..1899236e21ef1 100644 --- a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function philipsHueApiRequest( }); return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts index b320997a21c39..952e37b617e6c 100644 --- a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts @@ -90,6 +90,7 @@ export async function pipedriveApiRequest( data: responseData.data === null ? [] : responseData.data, }; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Plivo/GenericFunctions.ts b/packages/nodes-base/nodes/Plivo/GenericFunctions.ts index 6ac63db30f10e..0fd139fe02280 100644 --- a/packages/nodes-base/nodes/Plivo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Plivo/GenericFunctions.ts @@ -42,6 +42,7 @@ export async function plivoApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts index 2b2e54268cd70..3f881abe26eb7 100644 --- a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function posthogApiRequest( } return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index a1ceefe6eea5b..d2974e09987f7 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function postmarkApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts index 1400bdce88df0..8724f55a0c58a 100644 --- a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function profitWellApiRequest( return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts index 4904d0671372c..85de332b2172c 100644 --- a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts @@ -34,6 +34,7 @@ export async function pushbulletApiRequest( } return await this.helpers.requestOAuth2.call(this, 'pushbulletOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts index 9c96e60fb84e0..4315e8ebb267a 100644 --- a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function pushcutApiRequest( } return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushover/GenericFunctions.ts b/packages/nodes-base/nodes/Pushover/GenericFunctions.ts index 56051e59cf74c..c39df94c8b457 100644 --- a/packages/nodes-base/nodes/Pushover/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushover/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function pushoverApiRequest( return await this.helpers.requestWithAuthentication.call(this, 'pushoverApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts index 73d8232aa6c4a..5a57797996a05 100644 --- a/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts @@ -58,6 +58,7 @@ export async function quickbaseApiRequest( return await this.helpers?.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts index ebf727c3661f9..40ddca3974c9f 100644 --- a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts @@ -88,6 +88,7 @@ export async function quickBooksApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'quickBooksOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts index ac2e2d87bc1bb..957e2bb5d14c6 100644 --- a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function raindropApiRequest( includeCredentialsOnRefreshOnBody: true, }); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Reddit/GenericFunctions.ts b/packages/nodes-base/nodes/Reddit/GenericFunctions.ts index e18982f9b908d..88f8466c388c3 100644 --- a/packages/nodes-base/nodes/Reddit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Reddit/GenericFunctions.ts @@ -43,12 +43,14 @@ export async function redditApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'redditOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } else { try { return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/S3/GenericFunctions.ts b/packages/nodes-base/nodes/S3/GenericFunctions.ts index a31eb6ddd5427..ac122386b418a 100644 --- a/packages/nodes-base/nodes/S3/GenericFunctions.ts +++ b/packages/nodes-base/nodes/S3/GenericFunctions.ts @@ -92,6 +92,7 @@ export async function s3ApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/S3/S3.node.ts b/packages/nodes-base/nodes/S3/S3.node.ts index d7844ba9a449c..92968037ba528 100644 --- a/packages/nodes-base/nodes/S3/S3.node.ts +++ b/packages/nodes-base/nodes/S3/S3.node.ts @@ -94,6 +94,7 @@ export class S3 implements INodeType { try { credentials = await this.getCredentials('s3'); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 78454e3519994..91f1e622ea643 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -138,6 +138,7 @@ export async function salesforceApiRequest( return await this.helpers.requestOAuth2.call(this, credentialsType, options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts index 4db839ba1df21..6180c29c3ae15 100644 --- a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts +++ b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts @@ -1327,6 +1327,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1340,6 +1341,7 @@ export class Salesforce implements INodeType { `/sobjects/lead/${leadId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1671,6 +1673,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1684,6 +1687,7 @@ export class Salesforce implements INodeType { `/sobjects/contact/${contactId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1823,6 +1827,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1836,6 +1841,7 @@ export class Salesforce implements INodeType { `/sobjects/${customObject}/${recordId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2057,6 +2063,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2070,6 +2077,7 @@ export class Salesforce implements INodeType { `/sobjects/opportunity/${opportunityId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2345,6 +2353,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2358,6 +2367,7 @@ export class Salesforce implements INodeType { `/sobjects/account/${accountId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2560,6 +2570,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2573,6 +2584,7 @@ export class Salesforce implements INodeType { `/sobjects/case/${caseId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2823,6 +2835,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2836,6 +2849,7 @@ export class Salesforce implements INodeType { `/sobjects/task/${taskId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2955,6 +2969,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2968,6 +2983,7 @@ export class Salesforce implements INodeType { `/sobjects/attachment/${attachmentId}`, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -3010,6 +3026,7 @@ export class Salesforce implements INodeType { ); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts b/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts index 613ff5daca208..b1af4a57b3802 100644 --- a/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts +++ b/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts @@ -256,6 +256,7 @@ export class SalesforceTrigger implements INodeType { qs, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts index 287da42e7e743..282096360abec 100644 --- a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function salesmateApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts index b8ffb713279f7..1551d69a423cb 100644 --- a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts @@ -112,6 +112,7 @@ export async function seaTableApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts index fbfff300d65c7..9d1e9496f2259 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts @@ -46,6 +46,7 @@ export async function scorecardApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Sendy/GenericFunctions.ts b/packages/nodes-base/nodes/Sendy/GenericFunctions.ts index e55ffca5a5eec..31fe6b18addd2 100644 --- a/packages/nodes-base/nodes/Sendy/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Sendy/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function sendyApiRequest( try { return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts index 9c70f97994559..0b829c0690ec2 100644 --- a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts @@ -69,6 +69,7 @@ export async function sentryIoApiRequest( return await this.helpers.requestOAuth2.call(this, 'sentryIoOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts index ded0e97c32e8d..05ff8dfdfaac3 100644 --- a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function serviceNowApiRequest( authenticationMethod === 'oAuth2' ? 'serviceNowOAuth2Api' : 'serviceNowBasicApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Signl4/GenericFunctions.ts b/packages/nodes-base/nodes/Signl4/GenericFunctions.ts index 8ad84c272cf5d..1d783c5f0cd35 100644 --- a/packages/nodes-base/nodes/Signl4/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Signl4/GenericFunctions.ts @@ -47,6 +47,7 @@ export async function SIGNL4ApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts index c31607dc0ce74..75bcbd1f40c31 100644 --- a/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts @@ -78,6 +78,7 @@ export async function slackApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts index 5d463efaf51eb..912e73d95455d 100644 --- a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts @@ -173,6 +173,7 @@ export async function splunkApiRequest( error = { error: error.fatal }; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Spontit/GenericFunctions.ts b/packages/nodes-base/nodes/Spontit/GenericFunctions.ts index d4ca5e48fd8b5..39fd2190717f9 100644 --- a/packages/nodes-base/nodes/Spontit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Spontit/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function spontitApiRequest( return await this.helpers?.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts index 6b61655ee30fd..b3a323ab64c33 100644 --- a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts @@ -40,6 +40,7 @@ export async function spotifyApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'spotifyOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Stackby/GenericFunction.ts b/packages/nodes-base/nodes/Stackby/GenericFunction.ts index f5b6f8f4a3f77..821b591d7a2a0 100644 --- a/packages/nodes-base/nodes/Stackby/GenericFunction.ts +++ b/packages/nodes-base/nodes/Stackby/GenericFunction.ts @@ -48,6 +48,7 @@ export async function apiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts index 00401d97724fc..e526e46ce7038 100644 --- a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts @@ -55,6 +55,7 @@ export async function storyblokApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts index b687766037d8b..1d440945384b3 100644 --- a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts @@ -63,6 +63,7 @@ export async function strapiApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Strava/GenericFunctions.ts b/packages/nodes-base/nodes/Strava/GenericFunctions.ts index d5488b7e0e865..eaeb59d919f56 100644 --- a/packages/nodes-base/nodes/Strava/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strava/GenericFunctions.ts @@ -51,6 +51,7 @@ export async function stravaApiRequest( }); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts index b66248f9f5e6e..cc87545919b6e 100644 --- a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts @@ -47,6 +47,7 @@ export async function supabaseApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts index ec53b79698c5f..ab9cbd3b4a7fe 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts @@ -54,6 +54,7 @@ export async function surveyMonkeyApiRequest( return await this.helpers.requestOAuth2?.call(this, 'surveyMonkeyOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts b/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts index 13096d6962bca..209d8e7fee78e 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts @@ -36,6 +36,7 @@ export async function apiRequest( try { return await this.helpers.httpRequest(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts index d01e36cdd4a21..f314b7aa926e7 100644 --- a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function getAuthorization( return response.auth_token; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -80,6 +81,7 @@ export async function taigaApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts index 5c8a836926db2..88c0888e0003e 100644 --- a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts @@ -42,6 +42,7 @@ export async function tapfiliateApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts index cbffe21d5f06d..f5c86f8273bac 100644 --- a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts @@ -223,6 +223,7 @@ export async function apiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Todoist/GenericFunctions.ts b/packages/nodes-base/nodes/Todoist/GenericFunctions.ts index fb8cfc9bbad68..e2c3d632f5c9d 100644 --- a/packages/nodes-base/nodes/Todoist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Todoist/GenericFunctions.ts @@ -43,6 +43,7 @@ export async function todoistApiRequest( const credentialType = authentication === 'apiKey' ? 'todoistApi' : 'todoistOAuth2Api'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -70,6 +71,7 @@ export async function todoistSyncRequest( const credentialType = authentication === 'oAuth2' ? 'todoistOAuth2Api' : 'todoistApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts index 48b018a21577c..20de63a2f485e 100644 --- a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts @@ -48,6 +48,7 @@ export async function togglApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts b/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts index fcfcf87846f0d..41cb7f4bb9ca6 100644 --- a/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts +++ b/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts @@ -69,6 +69,7 @@ export class TogglTrigger implements INodeType { timeEntries = await togglApiRequest.call(this, 'GET', endpoint, {}, qs); webhookData.lastTimeChecked = qs.end_date; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } if (Array.isArray(timeEntries) && timeEntries.length !== 0) { diff --git a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts index b089998eb812c..ccd0d1d093800 100644 --- a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function travisciApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twist/GenericFunctions.ts b/packages/nodes-base/nodes/Twist/GenericFunctions.ts index 64a5f803b23f5..a7bc07c3f01bf 100644 --- a/packages/nodes-base/nodes/Twist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twist/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function twistApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'twistOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts index 40a19fea00718..42539f6e2e0bb 100644 --- a/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts @@ -37,6 +37,7 @@ export async function twitterApiRequest( } return await this.helpers.requestOAuth1.call(this, 'twitterOAuth1Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts b/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts index 33f238add0b2a..3cb36a3840f72 100644 --- a/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts @@ -52,6 +52,7 @@ export async function twitterApiRequest( } else if (error.errors && error.error?.errors[0].message.includes('must be ')) { throw new NodeOperationError(this.getNode(), error.error.errors[0].message as string); } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts index f7262b7a839f5..f71e8f58b012a 100644 --- a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts @@ -64,6 +64,7 @@ export async function apiRequest( return await this.helpers.requestOAuth2.call(this, 'typeformOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts index 23c0b1d8c62a8..5855842304a37 100644 --- a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts @@ -53,6 +53,7 @@ export async function unleashedApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts index 1c73b029fddd8..83281f3d19f84 100644 --- a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts @@ -35,6 +35,7 @@ export async function upleadApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts index 308c1c4a07154..3f2c78d9b90b4 100644 --- a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function uptimeRobotApiRequest( } return responseData; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index 933f8175ccf88..b4f19d886f7b0 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -62,6 +62,7 @@ export async function venafiApiRequest( options, ); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vero/GenericFunctions.ts b/packages/nodes-base/nodes/Vero/GenericFunctions.ts index 51df117aa1382..ae982ca88add9 100644 --- a/packages/nodes-base/nodes/Vero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vero/GenericFunctions.ts @@ -38,6 +38,7 @@ export async function veroApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vero/Vero.node.ts b/packages/nodes-base/nodes/Vero/Vero.node.ts index d4814263037fe..3ddeb32c9a801 100644 --- a/packages/nodes-base/nodes/Vero/Vero.node.ts +++ b/packages/nodes-base/nodes/Vero/Vero.node.ts @@ -103,6 +103,7 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', '/users/track', body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -117,6 +118,7 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'PUT', '/users/reidentify', body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -135,6 +137,7 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', `/users/${operation}`, body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -155,6 +158,7 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'PUT', '/users/tags/edit', body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -212,6 +216,7 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', '/events/track', body); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vonage/GenericFunctions.ts b/packages/nodes-base/nodes/Vonage/GenericFunctions.ts index 41618f755c926..1cd5ceb2b93a1 100644 --- a/packages/nodes-base/nodes/Vonage/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vonage/GenericFunctions.ts @@ -36,6 +36,7 @@ export async function vonageApiRequest( } return await this.helpers.request.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts b/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts index b50c9adad9e20..5846bc3ab2831 100644 --- a/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts @@ -35,6 +35,7 @@ async function appAccessTokenRead( try { return await this.helpers.httpRequest.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -64,6 +65,7 @@ async function whatsappApiRequest( try { return await this.helpers.httpRequest.call(this, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Wise/GenericFunctions.ts b/packages/nodes-base/nodes/Wise/GenericFunctions.ts index 8742dccd0125a..3befba1c79a41 100644 --- a/packages/nodes-base/nodes/Wise/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wise/GenericFunctions.ts @@ -67,6 +67,7 @@ export async function wiseApiRequest( response = await this.helpers.httpRequest(options); } catch (error) { delete error.config; + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts index ac0feb564cd77..f8f372d22c845 100644 --- a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function wordpressApiRequest( const credentialType = 'wordpressApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Workable/GenericFunctions.ts b/packages/nodes-base/nodes/Workable/GenericFunctions.ts index 8b6dbc7eaeb71..1f835d54e3137 100644 --- a/packages/nodes-base/nodes/Workable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Workable/GenericFunctions.ts @@ -39,6 +39,7 @@ export async function workableApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Xero/GenericFunctions.ts b/packages/nodes-base/nodes/Xero/GenericFunctions.ts index c1d7d372286e7..56a17fce6778e 100644 --- a/packages/nodes-base/nodes/Xero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Xero/GenericFunctions.ts @@ -41,6 +41,7 @@ export async function xeroApiRequest( } return await this.helpers.requestOAuth2.call(this, 'xeroOAuth2Api', options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Yourls/GenericFunctions.ts b/packages/nodes-base/nodes/Yourls/GenericFunctions.ts index c847c0714d6e7..e7a134ee059a7 100644 --- a/packages/nodes-base/nodes/Yourls/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Yourls/GenericFunctions.ts @@ -49,6 +49,7 @@ export async function yourlsApiRequest( return response; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts index aad3fa3d84917..b60be8857ffa5 100644 --- a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts @@ -79,6 +79,7 @@ export async function zammadApiRequest( error.error.error = 'An entity with this name already exists.'; } + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts index 337e8f3d19f84..2a63a0089de3d 100644 --- a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts +++ b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts @@ -477,6 +477,7 @@ export class Zendesk implements INodeType { ); responseData = responseData.ticket; } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index e02bbf642ac5d..ddeb83220d5f6 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -44,6 +44,7 @@ export async function zoomApiRequest( return await this.helpers.requestOAuth2.call(this, 'zoomOAuth2Api', options); } } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts index 12ef28ab5b329..6b7470b70aa5b 100644 --- a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts @@ -52,6 +52,7 @@ export async function zulipApiRequest( try { return await this.helpers.request(options); } catch (error) { + if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } From c9dd2400b34faca3fe1078f994fc76d78145c90b Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 09:45:36 +0300 Subject: [PATCH 2/6] Revert "prevent NodeApiError rewraping in request functions" This reverts commit d70d0410921c3acbbeeb20fd22332a1537733b93. --- .../nodes/ActiveCampaign/GenericFunctions.ts | 1 - .../nodes/AcuityScheduling/GenericFunctions.ts | 1 - .../nodes/Affinity/GenericFunctions.ts | 1 - .../nodes/AgileCrm/GenericFunctions.ts | 2 -- .../nodes/ApiTemplateIo/GenericFunctions.ts | 1 - .../nodes/Automizy/GenericFunctions.ts | 1 - .../nodes/Autopilot/GenericFunctions.ts | 1 - .../Aws/CertificateManager/GenericFunctions.ts | 1 - .../nodes/Aws/ELB/GenericFunctions.ts | 1 - .../nodes-base/nodes/Aws/SQS/AwsSqs.node.ts | 2 -- .../nodes/Aws/Textract/GenericFunctions.ts | 1 - .../nodes/Aws/Transcribe/GenericFunctions.ts | 1 - .../nodes/Bannerbear/GenericFunctions.ts | 1 - .../nodes/Baserow/GenericFunctions.ts | 2 -- .../nodes/Bitbucket/GenericFunctions.ts | 1 - .../nodes-base/nodes/Bitly/GenericFunctions.ts | 1 - .../nodes/Bitwarden/GenericFunctions.ts | 2 -- .../nodes-base/nodes/Box/GenericFunctions.ts | 1 - .../nodes/Brandfetch/GenericFunctions.ts | 1 - .../nodes-base/nodes/Bubble/GenericFunctions.ts | 1 - .../nodes/Chargebee/Chargebee.node.ts | 1 - .../nodes/CircleCi/GenericFunctions.ts | 1 - .../nodes/Cisco/Webex/GenericFunctions.ts | 1 - .../nodes/Citrix/ADC/GenericFunctions.ts | 1 - .../nodes/Clearbit/GenericFunctions.ts | 1 - .../nodes/ClickUp/GenericFunctions.ts | 1 - .../nodes/Cloudflare/GenericFunctions.ts | 1 - .../nodes/Cockpit/GenericFunctions.ts | 1 - .../nodes-base/nodes/Coda/GenericFunctions.ts | 1 - .../nodes/CoinGecko/GenericFunctions.ts | 1 - .../nodes/Contentful/GenericFunctions.ts | 1 - .../nodes/ConvertKit/GenericFunctions.ts | 1 - .../nodes-base/nodes/Copper/GenericFunctions.ts | 1 - .../nodes-base/nodes/DeepL/GenericFunctions.ts | 1 - .../nodes-base/nodes/Demio/GenericFunctions.ts | 1 - .../nodes-base/nodes/Dhl/GenericFunctions.ts | 1 - .../nodes/Discourse/GenericFunctions.ts | 1 - .../nodes-base/nodes/Disqus/GenericFunctions.ts | 1 - .../nodes-base/nodes/Drift/GenericFunctions.ts | 1 - .../nodes/Dropbox/GenericFunctions.ts | 1 - .../nodes-base/nodes/Egoi/GenericFunctions.ts | 1 - .../Elastic/ElasticSecurity/GenericFunctions.ts | 1 - .../Elastic/Elasticsearch/GenericFunctions.ts | 2 -- .../nodes/EmailSend/v2/send.operation.ts | 1 - .../nodes-base/nodes/Emelia/GenericFunctions.ts | 1 - .../nodes/Eventbrite/GenericFunctions.ts | 1 - .../nodes/Facebook/FacebookGraphApi.node.ts | 1 - .../nodes/Facebook/GenericFunctions.ts | 1 - .../nodes/FacebookLeadAds/GenericFunctions.ts | 3 --- .../nodes-base/nodes/Figma/GenericFunctions.ts | 1 - .../nodes/FileMaker/GenericFunctions.ts | 1 - packages/nodes-base/nodes/Flow/Flow.node.ts | 3 --- .../nodes-base/nodes/Flow/GenericFunctions.ts | 1 - .../nodes-base/nodes/FormIo/GenericFunctions.ts | 1 - .../nodes/Formstack/GenericFunctions.ts | 1 - .../nodes/Freshdesk/GenericFunctions.ts | 1 - .../nodes/Freshservice/GenericFunctions.ts | 1 - .../nodes/FreshworksCrm/GenericFunctions.ts | 1 - packages/nodes-base/nodes/Ftp/Ftp.node.ts | 2 -- .../nodes/GetResponse/GenericFunctions.ts | 1 - .../nodes-base/nodes/Github/GenericFunctions.ts | 1 - .../nodes-base/nodes/Gitlab/GenericFunctions.ts | 1 - .../nodes/Gitlab/GitlabTrigger.node.ts | 1 - .../nodes/GoToWebinar/GenericFunctions.ts | 1 - .../Google/BigQuery/v1/GenericFunctions.ts | 1 - .../nodes/Google/Books/GenericFunctions.ts | 1 - .../nodes/Google/Calendar/GenericFunctions.ts | 1 - .../nodes/Google/Chat/GenericFunctions.ts | 1 - .../CloudNaturalLanguage/GenericFunctions.ts | 1 - .../nodes/Google/Contacts/GenericFunctions.ts | 1 - .../nodes/Google/Docs/GenericFunctions.ts | 1 - .../nodes/Google/Drive/v1/GenericFunctions.ts | 1 - .../nodes/Google/Drive/v2/transport/index.ts | 1 - .../Firebase/CloudFirestore/GenericFunctions.ts | 1 - .../RealtimeDatabase/GenericFunctions.ts | 1 - .../Google/GSuiteAdmin/GenericFunctions.ts | 1 - .../Google/Perspective/GenericFunctions.ts | 1 - .../nodes/Google/Sheet/v1/GenericFunctions.ts | 1 - .../nodes/Google/Sheet/v2/transport/index.ts | 1 - .../nodes/Google/Slides/GenericFunctions.ts | 1 - .../nodes/Google/Task/GenericFunctions.ts | 1 - .../nodes/Google/Translate/GenericFunctions.ts | 1 - .../nodes/Google/YouTube/GenericFunctions.ts | 1 - .../nodes-base/nodes/Gotify/GenericFunctions.ts | 1 - .../nodes/Grafana/GenericFunctions.ts | 1 - .../nodes-base/nodes/Grist/GenericFunctions.ts | 1 - .../nodes/Gumroad/GenericFunctions.ts | 1 - .../nodes/HackerNews/GenericFunctions.ts | 1 - .../nodes/HaloPSA/GenericFunctions.ts | 2 -- .../nodes/Harvest/GenericFunctions.ts | 1 - .../nodes/HelpScout/GenericFunctions.ts | 1 - .../nodes/HomeAssistant/GenericFunctions.ts | 1 - .../nodes/Hubspot/V1/GenericFunctions.ts | 1 - .../nodes/Hubspot/V2/GenericFunctions.ts | 1 - .../nodes/HumanticAI/GenericFunctions.ts | 1 - .../nodes-base/nodes/Hunter/GenericFunctions.ts | 1 - .../nodes/Intercom/GenericFunctions.ts | 1 - .../nodes-base/nodes/Intercom/Intercom.node.ts | 8 -------- .../nodes/InvoiceNinja/GenericFunctions.ts | 1 - .../nodes/Iterable/GenericFunctions.ts | 1 - .../nodes/Jenkins/GenericFunctions.ts | 1 - .../nodes-base/nodes/Jenkins/Jenkins.node.ts | 3 --- .../nodes/JotForm/GenericFunctions.ts | 1 - .../nodes-base/nodes/Keap/GenericFunctions.ts | 1 - .../nodes-base/nodes/Line/GenericFunctions.ts | 1 - .../nodes-base/nodes/Linear/GenericFunctions.ts | 1 - .../nodes/LingvaNex/GenericFunctions.ts | 1 - .../nodes/LinkedIn/GenericFunctions.ts | 1 - .../nodes/Magento/GenericFunctions.ts | 1 - .../nodes/Mailchimp/GenericFunctions.ts | 1 - .../nodes/Mailchimp/MailchimpTrigger.node.ts | 1 - .../nodes/MailerLite/GenericFunctions.ts | 1 - .../nodes-base/nodes/Mailgun/Mailgun.node.ts | 1 - .../nodes/Mandrill/GenericFunctions.ts | 1 - .../nodes-base/nodes/Mandrill/Mandrill.node.ts | 1 - .../nodes/Marketstack/GenericFunctions.ts | 1 - .../nodes-base/nodes/Matrix/GenericFunctions.ts | 1 - .../nodes-base/nodes/Mautic/GenericFunctions.ts | 1 - .../nodes-base/nodes/Medium/GenericFunctions.ts | 1 - .../nodes/MessageBird/GenericFunctions.ts | 1 - .../Microsoft/Dynamics/GenericFunctions.ts | 1 - .../Microsoft/Excel/v1/GenericFunctions.ts | 1 - .../nodes/Microsoft/Excel/v2/transport/index.ts | 1 - .../Microsoft/GraphSecurity/GenericFunctions.ts | 1 - .../Microsoft/OneDrive/GenericFunctions.ts | 1 - .../Microsoft/Outlook/v1/GenericFunctions.ts | 1 - .../Microsoft/Teams/v1/GenericFunctions.ts | 1 - .../nodes/Microsoft/ToDo/GenericFunctions.ts | 1 - .../nodes-base/nodes/Mindee/GenericFunctions.ts | 1 - .../nodes-base/nodes/Misp/GenericFunctions.ts | 1 - .../nodes-base/nodes/Mocean/GenericFunctions.ts | 1 - .../nodes/MondayCom/GenericFunctions.ts | 1 - .../nodes/MonicaCrm/GenericFunctions.ts | 1 - .../nodes-base/nodes/Msg91/GenericFunctions.ts | 1 - .../nodes-base/nodes/N8n/GenericFunctions.ts | 1 - .../nodes-base/nodes/Nasa/GenericFunctions.ts | 1 - .../nodes/Netlify/GenericFunctions.ts | 1 - packages/nodes-base/nodes/NocoDB/NocoDB.node.ts | 3 --- .../nodes/Notion/shared/GenericFunctions.ts | 1 - .../nodes-base/nodes/Odoo/GenericFunctions.ts | 9 --------- .../nodes/OneSimpleApi/GenericFunctions.ts | 1 - .../nodes/Onfleet/GenericFunctions.ts | 1 - .../nodes/OpenThesaurus/GenericFunctions.ts | 1 - .../nodes/OpenWeatherMap/OpenWeatherMap.node.ts | 1 - .../nodes-base/nodes/Orbit/GenericFunctions.ts | 1 - .../nodes-base/nodes/Oura/GenericFunctions.ts | 1 - .../nodes-base/nodes/Paddle/GenericFunctions.ts | 1 - .../nodes/PagerDuty/GenericFunctions.ts | 1 - .../nodes-base/nodes/PayPal/GenericFunctions.ts | 1 - .../nodes/PayPal/PayPalTrigger.node.ts | 2 -- .../nodes/Phantombuster/GenericFunctions.ts | 1 - .../nodes/PhilipsHue/GenericFunctions.ts | 1 - .../nodes/Pipedrive/GenericFunctions.ts | 1 - .../nodes-base/nodes/Plivo/GenericFunctions.ts | 1 - .../nodes/PostHog/GenericFunctions.ts | 1 - .../nodes/Postmark/GenericFunctions.ts | 1 - .../nodes/ProfitWell/GenericFunctions.ts | 1 - .../nodes/Pushbullet/GenericFunctions.ts | 1 - .../nodes/Pushcut/GenericFunctions.ts | 1 - .../nodes/Pushover/GenericFunctions.ts | 1 - .../nodes/QuickBase/GenericFunctions.ts | 1 - .../nodes/QuickBooks/GenericFunctions.ts | 1 - .../nodes/Raindrop/GenericFunctions.ts | 1 - .../nodes-base/nodes/Reddit/GenericFunctions.ts | 2 -- .../nodes-base/nodes/S3/GenericFunctions.ts | 1 - packages/nodes-base/nodes/S3/S3.node.ts | 1 - .../nodes/Salesforce/GenericFunctions.ts | 1 - .../nodes/Salesforce/Salesforce.node.ts | 17 ----------------- .../nodes/Salesforce/SalesforceTrigger.node.ts | 1 - .../nodes/Salesmate/GenericFunctions.ts | 1 - .../nodes/SeaTable/GenericFunctions.ts | 1 - .../nodes/SecurityScorecard/GenericFunctions.ts | 1 - .../nodes-base/nodes/Sendy/GenericFunctions.ts | 1 - .../nodes/SentryIo/GenericFunctions.ts | 1 - .../nodes/ServiceNow/GenericFunctions.ts | 1 - .../nodes-base/nodes/Signl4/GenericFunctions.ts | 1 - .../nodes/Slack/V1/GenericFunctions.ts | 1 - .../nodes-base/nodes/Splunk/GenericFunctions.ts | 1 - .../nodes/Spontit/GenericFunctions.ts | 1 - .../nodes/Spotify/GenericFunctions.ts | 1 - .../nodes-base/nodes/Stackby/GenericFunction.ts | 1 - .../nodes/Storyblok/GenericFunctions.ts | 1 - .../nodes-base/nodes/Strapi/GenericFunctions.ts | 1 - .../nodes-base/nodes/Strava/GenericFunctions.ts | 1 - .../nodes/Supabase/GenericFunctions.ts | 1 - .../nodes/SurveyMonkey/GenericFunctions.ts | 1 - .../nodes/SyncroMSP/v1/transport/index.ts | 1 - .../nodes-base/nodes/Taiga/GenericFunctions.ts | 2 -- .../nodes/Tapfiliate/GenericFunctions.ts | 1 - .../nodes/Telegram/GenericFunctions.ts | 1 - .../nodes/Todoist/GenericFunctions.ts | 2 -- .../nodes-base/nodes/Toggl/GenericFunctions.ts | 1 - .../nodes-base/nodes/Toggl/TogglTrigger.node.ts | 1 - .../nodes/TravisCi/GenericFunctions.ts | 1 - .../nodes-base/nodes/Twist/GenericFunctions.ts | 1 - .../nodes/Twitter/V1/GenericFunctions.ts | 1 - .../nodes/Twitter/V2/GenericFunctions.ts | 1 - .../nodes/Typeform/GenericFunctions.ts | 1 - .../nodes/UnleashedSoftware/GenericFunctions.ts | 1 - .../nodes-base/nodes/Uplead/GenericFunctions.ts | 1 - .../nodes/UptimeRobot/GenericFunctions.ts | 1 - .../Venafi/ProtectCloud/GenericFunctions.ts | 1 - .../nodes-base/nodes/Vero/GenericFunctions.ts | 1 - packages/nodes-base/nodes/Vero/Vero.node.ts | 5 ----- .../nodes-base/nodes/Vonage/GenericFunctions.ts | 1 - .../nodes/WhatsApp/GenericFunctions.ts | 2 -- .../nodes-base/nodes/Wise/GenericFunctions.ts | 1 - .../nodes/Wordpress/GenericFunctions.ts | 1 - .../nodes/Workable/GenericFunctions.ts | 1 - .../nodes-base/nodes/Xero/GenericFunctions.ts | 1 - .../nodes-base/nodes/Yourls/GenericFunctions.ts | 1 - .../nodes-base/nodes/Zammad/GenericFunctions.ts | 1 - .../nodes-base/nodes/Zendesk/Zendesk.node.ts | 1 - .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 - .../nodes-base/nodes/Zulip/GenericFunctions.ts | 1 - 215 files changed, 270 deletions(-) diff --git a/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts b/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts index dd0562a706152..8aa041c3d4a7e 100644 --- a/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ActiveCampaign/GenericFunctions.ts @@ -63,7 +63,6 @@ export async function activeCampaignApiRequest( return responseData[dataKey] as IDataObject; } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts index 2ca12b0b396e4..ae68762998b78 100644 --- a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts @@ -54,7 +54,6 @@ export async function acuitySchedulingApiRequest( ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts index 1365edc349084..54ece184d5930 100644 --- a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function affinityApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts index 014cb5632a39b..f308b94c90bc0 100644 --- a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts @@ -50,7 +50,6 @@ export async function agileCrmApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -169,7 +168,6 @@ export async function agileCrmApiRequestUpdate( return lastSuccesfulUpdateReturn; } catch (error) { if (successfulUpdates.length === 0) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } else { throw new NodeApiError(this.getNode(), error as JsonObject, { diff --git a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts index e93d5fe2e699e..e099412bca88a 100644 --- a/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ApiTemplateIo/GenericFunctions.ts @@ -47,7 +47,6 @@ export async function apiTemplateIoApiRequest( } return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Automizy/GenericFunctions.ts b/packages/nodes-base/nodes/Automizy/GenericFunctions.ts index ae0d501a2c317..0e92d09333fc0 100644 --- a/packages/nodes-base/nodes/Automizy/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Automizy/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function automizyApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts index 11915ce14aaf3..f6387d27e9fa5 100644 --- a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function autopilotApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts index 03e93ac2f2aad..bff183fcee42e 100644 --- a/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/CertificateManager/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function awsApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts index 63686df49e2aa..51a88f61bafb0 100644 --- a/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/ELB/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function awsApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts index ee7f75795e725..bfd9d7fc1dc99 100644 --- a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts +++ b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts @@ -253,7 +253,6 @@ export class AwsSqs implements INodeType { // loads first 1000 queues from SQS data = await awsApiRequestSOAP.call(this, 'sqs', 'GET', `?${params.join('&')}`); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } @@ -373,7 +372,6 @@ export class AwsSqs implements INodeType { `${queuePath}?${params.join('&')}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts index ecf52094f3648..663c82b54e3db 100644 --- a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts @@ -70,7 +70,6 @@ export async function awsApiRequest( } } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); // no XML parsing needed } } diff --git a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts index cc44ba37dff6d..05faeb8a83ec6 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts @@ -68,7 +68,6 @@ export async function awsApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); // no XML parsing needed } } diff --git a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts index c28be9818da14..0e48b58d83a9f 100644 --- a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function bannerbearApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts index 2023c61c84366..8e30c5c1482b6 100644 --- a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function baserowApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -105,7 +104,6 @@ export async function getJwtToken( const { token } = (await this.helpers.request(options)) as { token: string }; return token; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts index 838a403fd5627..3281757d07acd 100644 --- a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function bitbucketApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts index c718bb3d92535..daadfdd508562 100644 --- a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function bitlyApiRequest( }); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index 2fc65974e2874..0bb12eac99e35 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -65,7 +65,6 @@ export async function bitwardenApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -100,7 +99,6 @@ export async function getAccessToken( const { access_token } = await this.helpers.request(options); return access_token; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Box/GenericFunctions.ts b/packages/nodes-base/nodes/Box/GenericFunctions.ts index 2f028270350fa..f768a217656b7 100644 --- a/packages/nodes-base/nodes/Box/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Box/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function boxApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'boxOAuth2Api', options, oAuth2Options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts index 59ffb0c8a90af..6a18a4579fc4b 100644 --- a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts @@ -53,7 +53,6 @@ export async function brandfetchApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts index 6ec4ca17f434d..46927492e96b6 100644 --- a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function bubbleApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts b/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts index d518edaa247f0..5db36b4bcbaa0 100644 --- a/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts +++ b/packages/nodes-base/nodes/Chargebee/Chargebee.node.ts @@ -598,7 +598,6 @@ export class Chargebee implements INodeType { try { responseData = await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts index e5ea96141219b..370981bebe607 100644 --- a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function circleciApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 2e852fe302d71..88d20374308b0 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -48,7 +48,6 @@ export async function webexApiRequest( tokenType: 'Bearer', }); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts index d21d34e2a949f..4b9e0ea9b5e28 100644 --- a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function citrixADCApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts index f6888436410ff..95a45b65afb2f 100644 --- a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function clearbitApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts index bbf53dde69aba..21974d6a08293 100644 --- a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts @@ -51,7 +51,6 @@ export async function clickupApiRequest( ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts index 9ae7db065cb86..3c6fc5c4163c4 100644 --- a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function cloudflareApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'cloudflareApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts index 06a3c5f22f965..f6b30fb9caac9 100644 --- a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function cockpitApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Coda/GenericFunctions.ts b/packages/nodes-base/nodes/Coda/GenericFunctions.ts index 4f5179cd0c2b7..b889e7dafa063 100644 --- a/packages/nodes-base/nodes/Coda/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Coda/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function codaApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts index cbfcb3f66868a..141ed62851816 100644 --- a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function coinGeckoApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts index e238d5aae4abd..270aadc44880d 100644 --- a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function contentfulApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts index 2b3b023998323..68569e4c8694f 100644 --- a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts @@ -52,7 +52,6 @@ export async function convertKitApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Copper/GenericFunctions.ts b/packages/nodes-base/nodes/Copper/GenericFunctions.ts index c0af415d214a8..2ffd1ca7cf675 100644 --- a/packages/nodes-base/nodes/Copper/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Copper/GenericFunctions.ts @@ -64,7 +64,6 @@ export async function copperApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts index 2e9b63bc776d1..649096fc00661 100644 --- a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts +++ b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function deepLApiRequest( return await this.helpers.requestWithAuthentication.call(this, 'deepLApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Demio/GenericFunctions.ts b/packages/nodes-base/nodes/Demio/GenericFunctions.ts index 2de67312d8b6c..17c113be7fad8 100644 --- a/packages/nodes-base/nodes/Demio/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Demio/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function demioApiRequest( return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts index 33339b6ceee7e..1a062fb12a3c4 100644 --- a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function dhlApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Discourse/GenericFunctions.ts b/packages/nodes-base/nodes/Discourse/GenericFunctions.ts index 83b4e17bb8a44..8a66a6296debf 100644 --- a/packages/nodes-base/nodes/Discourse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Discourse/GenericFunctions.ts @@ -33,7 +33,6 @@ export async function discourseApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'discourseApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts index aa23c908c8ef1..8d03fe04075ef 100644 --- a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function disqusApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index 9352a6154cba2..44bfb8c2a7e50 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -50,7 +50,6 @@ export async function driftApiRequest( return await this.helpers.requestOAuth2.call(this, 'driftOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts index 14be971daeb44..86e9d655699d8 100644 --- a/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dropbox/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function dropboxApiRequest( return await this.helpers.requestOAuth2.call(this, 'dropboxOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts index aa951ecc10079..a20e5e87613d2 100644 --- a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function egoiApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts index aea4720439ce9..696170cff1af3 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts @@ -58,7 +58,6 @@ export async function elasticSecurityApiRequest( error.error.error = `${error.error.error}: ${error.error.message}`; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts index 054450d8238dd..ed013079f8cc6 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function elasticsearchApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'elasticsearchApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -104,7 +103,6 @@ export async function elasticsearchApiRequestAllItems( return returnData; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts index e289634e6ae91..8e9623c67d3dc 100644 --- a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts +++ b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts @@ -336,7 +336,6 @@ export async function execute(this: IExecuteFunctions): Promise (a.name > b.name ? 0 : 1)); return items; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Flow/Flow.node.ts b/packages/nodes-base/nodes/Flow/Flow.node.ts index 6c27419a1fd98..c39a37d7987d4 100644 --- a/packages/nodes-base/nodes/Flow/Flow.node.ts +++ b/packages/nodes-base/nodes/Flow/Flow.node.ts @@ -125,7 +125,6 @@ export class Flow implements INodeType { responseData = await flowApiRequest.call(this, 'POST', '/tasks', body); responseData = responseData.task; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -194,7 +193,6 @@ export class Flow implements INodeType { responseData = await flowApiRequest.call(this, 'PUT', `/tasks/${taskId}`, body); responseData = responseData.task; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -209,7 +207,6 @@ export class Flow implements INodeType { try { responseData = await flowApiRequest.call(this, 'GET', `/tasks/${taskId}`, {}, qs); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Flow/GenericFunctions.ts b/packages/nodes-base/nodes/Flow/GenericFunctions.ts index 3b5fa67a6197c..0f304e64150ef 100644 --- a/packages/nodes-base/nodes/Flow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Flow/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function flowApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts index 856e80149254b..52dfbf944e323 100644 --- a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts @@ -82,7 +82,6 @@ export async function formIoApiRequest( try { return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts index 81229703fd651..fe53058349a22 100644 --- a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts @@ -81,7 +81,6 @@ export async function apiRequest( return await this.helpers.requestOAuth2.call(this, 'formstackOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts index 6296ceae37afc..59578dfea3e62 100644 --- a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function freshdeskApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts index ad4146efc7480..558a34c125ab9 100644 --- a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts @@ -69,7 +69,6 @@ export async function freshserviceApiRequest( } } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts b/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts index f0f64c7faddd0..5bcdafc5aeccb 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function freshworksCrmApiRequest( const credentialsType = 'freshworksCrmApi'; return await this.helpers.requestWithAuthentication.call(this, credentialsType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Ftp/Ftp.node.ts b/packages/nodes-base/nodes/Ftp/Ftp.node.ts index e0c9ddce8cbbf..850c9eae54402 100644 --- a/packages/nodes-base/nodes/Ftp/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp/Ftp.node.ts @@ -786,7 +786,6 @@ export class Ftp implements INodeType { await ftp!.mkdir(dirPath, true); await ftp!.put(uploadData, remotePath); } else { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -804,7 +803,6 @@ export class Ftp implements INodeType { await ftp!.mkdir(dirPath, true); await ftp!.put(buffer, remotePath); } else { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts index 27c2b83f3907c..1271dea98ca07 100644 --- a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function getresponseApiRequest( return await this.helpers.requestOAuth2.call(this, 'getResponseOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Github/GenericFunctions.ts b/packages/nodes-base/nodes/Github/GenericFunctions.ts index 1dd0e5e35feb9..a27618b3dbdb2 100644 --- a/packages/nodes-base/nodes/Github/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Github/GenericFunctions.ts @@ -60,7 +60,6 @@ export async function githubApiRequest( return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts index 17c1042f3a1e8..c898041b541b8 100644 --- a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts @@ -51,7 +51,6 @@ export async function gitlabApiRequest( return await this.helpers.requestOAuth2.call(this, 'gitlabOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts index f5e7bd06c091b..12febc14e5205 100644 --- a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts +++ b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts @@ -250,7 +250,6 @@ export class GitlabTrigger implements INodeType { try { responseData = await gitlabApiRequest.call(this, 'POST', endpoint, body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts index cddd4465bc22e..4d85e51375b4c 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts @@ -77,7 +77,6 @@ export async function goToWebinarApiRequest( // https://stackoverflow.com/questions/62190724/getting-gotowebinar-registrant return losslessJSON.parse(response as string, convertLosslessNumber); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts index 792aad2756b47..d4456f318b2ca 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/v1/GenericFunctions.ts @@ -61,7 +61,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index bd21ca1a2b27e..ab8d73f58e576 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -60,7 +60,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts index 8c143df716bd8..819e67cd4665d 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts index 52e2f54efc72e..442ba4799d581 100644 --- a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts @@ -57,7 +57,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } if (Object.keys(responseData as IDataObject).length !== 0) { diff --git a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts index c4f53b02f55ee..58cb39c8b0b08 100644 --- a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function googleApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts index 664926b8ec558..6c07a1a0daedb 100644 --- a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleContactsOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts index ac91a6414711d..02183796d3d2a 100644 --- a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts @@ -50,7 +50,6 @@ export async function googleApiRequest( return await this.helpers.requestOAuth2.call(this, 'googleDocsOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts index e4f70891388b3..16171fb75f421 100644 --- a/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/v1/GenericFunctions.ts @@ -59,7 +59,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts index b91e879c8f7f3..b0d984f529b38 100644 --- a/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Drive/v2/transport/index.ts @@ -63,7 +63,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts index 0c329df17b45d..328fa246feca2 100644 --- a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function googleApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts index 9df7c2475bbc2..fb19c1d4d893c 100644 --- a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts @@ -48,7 +48,6 @@ export async function googleApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts index 81efddee03af2..7f30fe6812e29 100644 --- a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'gSuiteAdminOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts index 261275c79e92c..fdc1b043f598f 100644 --- a/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Perspective/GenericFunctions.ts @@ -25,7 +25,6 @@ export async function googleApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'googlePerspectiveOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index d3ecfd5364864..540367aabd085 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -64,7 +64,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts index 7d38360c723d8..d3fe3e07620c8 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts @@ -74,7 +74,6 @@ export async function apiRequest( throw error; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts index 064e7479692ce..98cbb28ecd06c 100644 --- a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts @@ -56,7 +56,6 @@ export async function googleApiRequest( error.statusCode = '401'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts index a40d305eedc3e..c0e69151e4aa0 100644 --- a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleTasksOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts index 17812d70cf5f0..d85912801a720 100644 --- a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function googleApiRequest( return await this.helpers.requestOAuth2.call(this, 'googleTranslateOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts index ad80130852578..acd718c1b2b19 100644 --- a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function googleApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'youTubeOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts index 61541c7252314..8aa00f4ace6c3 100644 --- a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function gotifyApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Grafana/GenericFunctions.ts b/packages/nodes-base/nodes/Grafana/GenericFunctions.ts index c64b69a168c3a..9fb11f7c0ec72 100644 --- a/packages/nodes-base/nodes/Grafana/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Grafana/GenericFunctions.ts @@ -72,7 +72,6 @@ export async function grafanaApiRequest( 'Invalid credentials or error in establishing connection with given credentials'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Grist/GenericFunctions.ts b/packages/nodes-base/nodes/Grist/GenericFunctions.ts index cc0cf76a9174d..07a4505d35eda 100644 --- a/packages/nodes-base/nodes/Grist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Grist/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function gristApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts index 028b4884091f9..8c4e810e670a3 100644 --- a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function gumroadApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts index f30c092e6e4d2..414ce7a2797f5 100644 --- a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts @@ -29,7 +29,6 @@ export async function hackerNewsApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts index e2040dd6b70cf..f6ac15258d756 100644 --- a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts @@ -54,7 +54,6 @@ export async function getAccessTokens( const tokens = await this.helpers.request(options); return tokens; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -113,7 +112,6 @@ export async function haloPSAApiRequest( .toLowerCase()}.`; } } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts index 2081c8e655ea9..66c1865650f8d 100644 --- a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function harvestApiRequest( return await this.helpers.requestOAuth2.call(this, 'harvestOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts index 9e4d5de948010..6ad5fbdbc71e0 100644 --- a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function helpscoutApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'helpScoutOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts index d1202de84bd4d..58194341bcb7a 100644 --- a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function homeAssistantApiRequest( return await this.helpers.request(options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts index 3b99e0312f795..9fa600730d182 100644 --- a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts @@ -68,7 +68,6 @@ export async function hubspotApiRequest( }); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts index 9461cfa26f3d0..c5b255ab6c386 100644 --- a/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts @@ -60,7 +60,6 @@ export async function hubspotApiRequest( }); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts index 7b8a3c39a6093..bd0479e0f0554 100644 --- a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function humanticAiApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts index 473fa0164ee90..d78a2d204a3f5 100644 --- a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function hunterApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts index 69e9b514d3acf..6ebbfd0642ec4 100644 --- a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function intercomApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Intercom/Intercom.node.ts b/packages/nodes-base/nodes/Intercom/Intercom.node.ts index dbeb47432d813..ba16a6422726a 100644 --- a/packages/nodes-base/nodes/Intercom/Intercom.node.ts +++ b/packages/nodes-base/nodes/Intercom/Intercom.node.ts @@ -83,7 +83,6 @@ export class Intercom implements INodeType { try { response = await intercomApiRequest.call(this, '/companies', 'GET'); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } const companies = response.companies; @@ -203,7 +202,6 @@ export class Intercom implements INodeType { try { responseData = await intercomApiRequest.call(this, '/contacts', 'POST', body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -227,7 +225,6 @@ export class Intercom implements INodeType { responseData = responseData.contacts; } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -252,7 +249,6 @@ export class Intercom implements INodeType { responseData = responseData.contacts; } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -267,7 +263,6 @@ export class Intercom implements INodeType { responseData = await intercomApiRequest.call(this, '/contacts', 'DELETE', {}, qs); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -383,7 +378,6 @@ export class Intercom implements INodeType { try { responseData = await intercomApiRequest.call(this, '/users', 'POST', body, qs); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -406,7 +400,6 @@ export class Intercom implements INodeType { responseData = await intercomApiRequest.call(this, '/users', 'GET', {}, qs); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -431,7 +424,6 @@ export class Intercom implements INodeType { responseData = responseData.users; } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts index 3d0243fa12317..76750e8fd9f2b 100644 --- a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts +++ b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function invoiceNinjaApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'invoiceNinjaApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts index 2eb9590fa2a89..7ecc3cae029fd 100644 --- a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function iterableApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts index 23e3c10ab6cc9..16bfe735b94b0 100644 --- a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function jenkinsApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts index 866ffe98c6983..5ba983f2e5a09 100644 --- a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts +++ b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts @@ -538,7 +538,6 @@ export class Jenkins implements INodeType { if (error.httpCode === '302') { responseData = { success: true }; } else { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -591,7 +590,6 @@ export class Jenkins implements INodeType { if (error.httpCode === '503') { responseData = { success: true }; } else { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -604,7 +602,6 @@ export class Jenkins implements INodeType { if (error.httpCode === '503') { responseData = { success: true }; } else { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts index 1905fbbbeb963..bd6292840dc90 100644 --- a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function jotformApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Keap/GenericFunctions.ts b/packages/nodes-base/nodes/Keap/GenericFunctions.ts index b2626639fe349..896c4449a9c45 100644 --- a/packages/nodes-base/nodes/Keap/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Keap/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function keapApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'keapOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Line/GenericFunctions.ts b/packages/nodes-base/nodes/Line/GenericFunctions.ts index b37e59e9612d8..01ffb695062f5 100644 --- a/packages/nodes-base/nodes/Line/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Line/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function lineApiRequest( tokenType: 'Bearer', }); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Linear/GenericFunctions.ts b/packages/nodes-base/nodes/Linear/GenericFunctions.ts index 41d045f0577c4..4d008f2ac5d87 100644 --- a/packages/nodes-base/nodes/Linear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Linear/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function linearApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts index f809f61e33b1d..ef41a8806154e 100644 --- a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts @@ -42,7 +42,6 @@ export async function lingvaNexApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts index 85f14317f96fe..45c941b3edd44 100644 --- a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts @@ -68,7 +68,6 @@ export async function linkedInApiRequest( }), ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Magento/GenericFunctions.ts b/packages/nodes-base/nodes/Magento/GenericFunctions.ts index 6a3def5c99ac7..f4255a3194155 100644 --- a/packages/nodes-base/nodes/Magento/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Magento/GenericFunctions.ts @@ -42,7 +42,6 @@ export async function magentoApiRequest( //@ts-ignore return await this.helpers.requestWithAuthentication.call(this, 'magento2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 9a03740bdb7a0..3c9627ef7d35d 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -77,7 +77,6 @@ export async function mailchimpApiRequest( }); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts index a351e58e82ead..e2edbe41e0574 100644 --- a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts @@ -207,7 +207,6 @@ export class MailchimpTrigger implements INodeType { } throw error; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } return true; diff --git a/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts b/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts index fb36108a58fb8..2459f349d1279 100644 --- a/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MailerLite/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function mailerliteApiRequest( //@ts-ignore return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts index 81739ac74b01d..24e151d349154 100644 --- a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts +++ b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts @@ -184,7 +184,6 @@ export class Mailgun implements INodeType { options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts index 14f0bb30fc66f..b2b08ce01a0a0 100644 --- a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function mandrillApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts index da58b7ee17440..ab740ed87dafd 100644 --- a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts +++ b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts @@ -692,7 +692,6 @@ export class Mandrill implements INodeType { try { templates = await mandrillApiRequest.call(this, '/templates', 'POST', '/list'); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } for (const template of templates) { diff --git a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts index e092fca9e6094..6e8511967a61f 100644 --- a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts @@ -34,7 +34,6 @@ export async function marketstackApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index 971ded9778c1c..112db518da881 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -51,7 +51,6 @@ export async function matrixApiRequest( //@ts-ignore return options.overridePrefix === 'media' ? JSON.parse(response as string) : response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts index 4683183555b8d..415c70afc0f07 100644 --- a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts @@ -57,7 +57,6 @@ export async function mauticApiRequest( return returnData; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Medium/GenericFunctions.ts b/packages/nodes-base/nodes/Medium/GenericFunctions.ts index 912f7e2eba3dc..5952c07485b63 100644 --- a/packages/nodes-base/nodes/Medium/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Medium/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function mediumApiRequest( return await this.helpers.requestOAuth2.call(this, 'mediumOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts index 9e542098c31ee..b8183d08c3c73 100644 --- a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function messageBirdApiRequest( } return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts index a066c9f870d7f..c4ec69687855f 100644 --- a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts @@ -47,7 +47,6 @@ export async function microsoftApiRequest( property: 'id_token', }); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts index 95ff134ca48f9..de358224381a1 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/v1/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function microsoftApiRequest( return await this.helpers.requestOAuth2.call(this, 'microsoftExcelOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts b/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts index 749b6d743b93d..61d0c4b1c4ac4 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/v2/transport/index.ts @@ -33,7 +33,6 @@ export async function microsoftApiRequest( } return await this.helpers.requestOAuth2.call(this, 'microsoftExcelOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts index 6d6d534b83c3e..dbc1c40661f6b 100644 --- a/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/GraphSecurity/GenericFunctions.ts @@ -69,7 +69,6 @@ export async function msGraphSecurityApiRequest( ' - Please check that your query parameter syntax is correct: https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts index 6e1cd257a2d4d..b709cb0e685fc 100644 --- a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftOneDriveOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts index e156b74014e21..17d175a46b791 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts @@ -50,7 +50,6 @@ export async function microsoftApiRequest( return await this.helpers.requestOAuth2.call(this, 'microsoftOutlookOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts index 68627d65707ad..0449ead6cb947 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/v1/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftTeamsOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts index d5350e0e130ba..4f5e4deb71302 100644 --- a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function microsoftApiRequest( //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mindee/GenericFunctions.ts b/packages/nodes-base/nodes/Mindee/GenericFunctions.ts index d22e957b635a2..35b5e19742db3 100644 --- a/packages/nodes-base/nodes/Mindee/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mindee/GenericFunctions.ts @@ -54,7 +54,6 @@ export async function mindeeApiRequest( return await this.helpers.requestWithAuthentication.call(this, service, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Misp/GenericFunctions.ts b/packages/nodes-base/nodes/Misp/GenericFunctions.ts index 322d23555deda..bdf59bda34e08 100644 --- a/packages/nodes-base/nodes/Misp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Misp/GenericFunctions.ts @@ -63,7 +63,6 @@ export async function mispApiRequest( } } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Mocean/GenericFunctions.ts b/packages/nodes-base/nodes/Mocean/GenericFunctions.ts index f41641111930d..b6ef63be09a51 100644 --- a/packages/nodes-base/nodes/Mocean/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mocean/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function moceanApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts index 7e8f679635798..ff993c7d1c6ca 100644 --- a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function mondayComApiRequest( } return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts index 168a6fb7437f3..e8f9e66778a91 100644 --- a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function monicaCrmApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Msg91/GenericFunctions.ts b/packages/nodes-base/nodes/Msg91/GenericFunctions.ts index 0dc01d82dbc42..35ef4e00ac5dc 100644 --- a/packages/nodes-base/nodes/Msg91/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Msg91/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function msg91ApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/N8n/GenericFunctions.ts b/packages/nodes-base/nodes/N8n/GenericFunctions.ts index 12ff8a142044a..e190d8abb0406 100644 --- a/packages/nodes-base/nodes/N8n/GenericFunctions.ts +++ b/packages/nodes-base/nodes/N8n/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function apiRequest( if (error instanceof NodeApiError) { throw error; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts index 8dd36ae48dfa5..0b69c55a6f77d 100644 --- a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts @@ -34,7 +34,6 @@ export async function nasaApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts index 1b8d69a966ffd..1c17f44b308b5 100644 --- a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts @@ -45,7 +45,6 @@ export async function netlifyApiRequest( return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts index 4a12ebbafcd58..bfe3f4c090e6e 100644 --- a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts +++ b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts @@ -399,7 +399,6 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -463,7 +462,6 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -755,7 +753,6 @@ export class NocoDB implements INodeType { if (this.continueOnFail()) { returnData.push({ error: error.toString() }); } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts index 0090118f57cd9..9ae5e52848237 100644 --- a/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts @@ -76,7 +76,6 @@ export async function notionApiRequest( } return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts index 22c84492e0861..53634b6438a02 100644 --- a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts @@ -129,7 +129,6 @@ export async function odooJSONRPCRequest( } return responce.result; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -165,7 +164,6 @@ export async function odooGetModelFields( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -202,7 +200,6 @@ export async function odooCreate( const result = await odooJSONRPCRequest.call(this, body, url); return { id: result }; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -247,7 +244,6 @@ export async function odooGet( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -289,7 +285,6 @@ export async function odooGetAll( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -340,7 +335,6 @@ export async function odooUpdate( await odooJSONRPCRequest.call(this, body, url); return { id: itemsID }; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -383,7 +377,6 @@ export async function odooDelete( await odooJSONRPCRequest.call(this, body, url); return { success: true }; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -409,7 +402,6 @@ export async function odooGetUserID( const loginResult = await odooJSONRPCRequest.call(this, body, url); return loginResult as unknown as number; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -432,7 +424,6 @@ export async function odooGetServerVersion( const result = await odooJSONRPCRequest.call(this, body, url); return result; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts index df06408033f1e..f8efd5ddc11e3 100644 --- a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function oneSimpleApiRequest( const responseData = await this.helpers.request(options); return responseData; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts index a7e29807448fa..87c1b0be28fd3 100644 --- a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function onfleetApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts index 74fd12b3b2fe7..33b7906adf44c 100644 --- a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function openThesaurusApiRequest( return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts b/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts index 23005f1150736..f1f40ffc32990 100644 --- a/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts +++ b/packages/nodes-base/nodes/OpenWeatherMap/OpenWeatherMap.node.ts @@ -270,7 +270,6 @@ export class OpenWeatherMap implements INodeType { try { responseData = await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts index f76edc1d1b807..7759f248efb16 100644 --- a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function orbitApiRequest( return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Oura/GenericFunctions.ts b/packages/nodes-base/nodes/Oura/GenericFunctions.ts index 6e38704cdb74a..9fb9691822004 100644 --- a/packages/nodes-base/nodes/Oura/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Oura/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function ouraApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts index 3b3e3f04974f6..ea6808cf1ca29 100644 --- a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function paddleApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index 1dfdd8b5f689d..3206e205871d0 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -58,7 +58,6 @@ export async function pagerDutyApiRequest( return await this.helpers.requestOAuth2.call(this, 'pagerDutyOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts index f814910cdb624..60f597cbe8107 100644 --- a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts @@ -72,7 +72,6 @@ export async function payPalApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts b/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts index 3e90e53d54b24..309c6d519340c 100644 --- a/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts +++ b/packages/nodes-base/nodes/PayPal/PayPalTrigger.node.ts @@ -73,7 +73,6 @@ export class PayPalTrigger implements INodeType { const endpoint = '/notifications/webhooks-event-types'; events = await payPalApiRequest.call(this, endpoint, 'GET'); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } for (const event of events.event_types) { @@ -109,7 +108,6 @@ export class PayPalTrigger implements INodeType { delete webhookData.webhookId; return false; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } return true; diff --git a/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts b/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts index a137540368264..35abf9dde46d4 100644 --- a/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Phantombuster/GenericFunctions.ts @@ -31,7 +31,6 @@ export async function phantombusterApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'phantombusterApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts index 1899236e21ef1..2e739fb536b81 100644 --- a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function philipsHueApiRequest( }); return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts index 952e37b617e6c..b320997a21c39 100644 --- a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts @@ -90,7 +90,6 @@ export async function pipedriveApiRequest( data: responseData.data === null ? [] : responseData.data, }; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Plivo/GenericFunctions.ts b/packages/nodes-base/nodes/Plivo/GenericFunctions.ts index 0fd139fe02280..6ac63db30f10e 100644 --- a/packages/nodes-base/nodes/Plivo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Plivo/GenericFunctions.ts @@ -42,7 +42,6 @@ export async function plivoApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts index 3f881abe26eb7..2b2e54268cd70 100644 --- a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function posthogApiRequest( } return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index d2974e09987f7..a1ceefe6eea5b 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function postmarkApiRequest( try { return await this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts index 8724f55a0c58a..1400bdce88df0 100644 --- a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function profitWellApiRequest( return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts index 85de332b2172c..4904d0671372c 100644 --- a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts @@ -34,7 +34,6 @@ export async function pushbulletApiRequest( } return await this.helpers.requestOAuth2.call(this, 'pushbulletOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts index 4315e8ebb267a..9c96e60fb84e0 100644 --- a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function pushcutApiRequest( } return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Pushover/GenericFunctions.ts b/packages/nodes-base/nodes/Pushover/GenericFunctions.ts index c39df94c8b457..56051e59cf74c 100644 --- a/packages/nodes-base/nodes/Pushover/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushover/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function pushoverApiRequest( return await this.helpers.requestWithAuthentication.call(this, 'pushoverApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts index 5a57797996a05..73d8232aa6c4a 100644 --- a/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBase/GenericFunctions.ts @@ -58,7 +58,6 @@ export async function quickbaseApiRequest( return await this.helpers?.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts index 40ddca3974c9f..ebf727c3661f9 100644 --- a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts @@ -88,7 +88,6 @@ export async function quickBooksApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'quickBooksOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts index 957e2bb5d14c6..ac2e2d87bc1bb 100644 --- a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function raindropApiRequest( includeCredentialsOnRefreshOnBody: true, }); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Reddit/GenericFunctions.ts b/packages/nodes-base/nodes/Reddit/GenericFunctions.ts index 88f8466c388c3..e18982f9b908d 100644 --- a/packages/nodes-base/nodes/Reddit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Reddit/GenericFunctions.ts @@ -43,14 +43,12 @@ export async function redditApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'redditOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } else { try { return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/S3/GenericFunctions.ts b/packages/nodes-base/nodes/S3/GenericFunctions.ts index ac122386b418a..a31eb6ddd5427 100644 --- a/packages/nodes-base/nodes/S3/GenericFunctions.ts +++ b/packages/nodes-base/nodes/S3/GenericFunctions.ts @@ -92,7 +92,6 @@ export async function s3ApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/S3/S3.node.ts b/packages/nodes-base/nodes/S3/S3.node.ts index 92968037ba528..d7844ba9a449c 100644 --- a/packages/nodes-base/nodes/S3/S3.node.ts +++ b/packages/nodes-base/nodes/S3/S3.node.ts @@ -94,7 +94,6 @@ export class S3 implements INodeType { try { credentials = await this.getCredentials('s3'); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 91f1e622ea643..78454e3519994 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -138,7 +138,6 @@ export async function salesforceApiRequest( return await this.helpers.requestOAuth2.call(this, credentialsType, options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts index 6180c29c3ae15..4db839ba1df21 100644 --- a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts +++ b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts @@ -1327,7 +1327,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1341,7 +1340,6 @@ export class Salesforce implements INodeType { `/sobjects/lead/${leadId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1673,7 +1671,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1687,7 +1684,6 @@ export class Salesforce implements INodeType { `/sobjects/contact/${contactId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1827,7 +1823,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -1841,7 +1836,6 @@ export class Salesforce implements INodeType { `/sobjects/${customObject}/${recordId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2063,7 +2057,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2077,7 +2070,6 @@ export class Salesforce implements INodeType { `/sobjects/opportunity/${opportunityId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2353,7 +2345,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2367,7 +2358,6 @@ export class Salesforce implements INodeType { `/sobjects/account/${accountId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2570,7 +2560,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2584,7 +2573,6 @@ export class Salesforce implements INodeType { `/sobjects/case/${caseId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2835,7 +2823,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2849,7 +2836,6 @@ export class Salesforce implements INodeType { `/sobjects/task/${taskId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2969,7 +2955,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -2983,7 +2968,6 @@ export class Salesforce implements INodeType { `/sobjects/attachment/${attachmentId}`, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -3026,7 +3010,6 @@ export class Salesforce implements INodeType { ); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts b/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts index b1af4a57b3802..613ff5daca208 100644 --- a/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts +++ b/packages/nodes-base/nodes/Salesforce/SalesforceTrigger.node.ts @@ -256,7 +256,6 @@ export class SalesforceTrigger implements INodeType { qs, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts index 282096360abec..287da42e7e743 100644 --- a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function salesmateApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts index 1551d69a423cb..b8ffb713279f7 100644 --- a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts @@ -112,7 +112,6 @@ export async function seaTableApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts index 9d1e9496f2259..fbfff300d65c7 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function scorecardApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Sendy/GenericFunctions.ts b/packages/nodes-base/nodes/Sendy/GenericFunctions.ts index 31fe6b18addd2..e55ffca5a5eec 100644 --- a/packages/nodes-base/nodes/Sendy/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Sendy/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function sendyApiRequest( try { return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts index 0b829c0690ec2..9c70f97994559 100644 --- a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts @@ -69,7 +69,6 @@ export async function sentryIoApiRequest( return await this.helpers.requestOAuth2.call(this, 'sentryIoOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts index 05ff8dfdfaac3..ded0e97c32e8d 100644 --- a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function serviceNowApiRequest( authenticationMethod === 'oAuth2' ? 'serviceNowOAuth2Api' : 'serviceNowBasicApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Signl4/GenericFunctions.ts b/packages/nodes-base/nodes/Signl4/GenericFunctions.ts index 1d783c5f0cd35..8ad84c272cf5d 100644 --- a/packages/nodes-base/nodes/Signl4/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Signl4/GenericFunctions.ts @@ -47,7 +47,6 @@ export async function SIGNL4ApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts index 75bcbd1f40c31..c31607dc0ce74 100644 --- a/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Slack/V1/GenericFunctions.ts @@ -78,7 +78,6 @@ export async function slackApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts index 912e73d95455d..5d463efaf51eb 100644 --- a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts @@ -173,7 +173,6 @@ export async function splunkApiRequest( error = { error: error.fatal }; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Spontit/GenericFunctions.ts b/packages/nodes-base/nodes/Spontit/GenericFunctions.ts index 39fd2190717f9..d4ca5e48fd8b5 100644 --- a/packages/nodes-base/nodes/Spontit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Spontit/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function spontitApiRequest( return await this.helpers?.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts index b3a323ab64c33..6b61655ee30fd 100644 --- a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts @@ -40,7 +40,6 @@ export async function spotifyApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'spotifyOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Stackby/GenericFunction.ts b/packages/nodes-base/nodes/Stackby/GenericFunction.ts index 821b591d7a2a0..f5b6f8f4a3f77 100644 --- a/packages/nodes-base/nodes/Stackby/GenericFunction.ts +++ b/packages/nodes-base/nodes/Stackby/GenericFunction.ts @@ -48,7 +48,6 @@ export async function apiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts index e526e46ce7038..00401d97724fc 100644 --- a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts @@ -55,7 +55,6 @@ export async function storyblokApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts index 1d440945384b3..b687766037d8b 100644 --- a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts @@ -63,7 +63,6 @@ export async function strapiApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Strava/GenericFunctions.ts b/packages/nodes-base/nodes/Strava/GenericFunctions.ts index eaeb59d919f56..d5488b7e0e865 100644 --- a/packages/nodes-base/nodes/Strava/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strava/GenericFunctions.ts @@ -51,7 +51,6 @@ export async function stravaApiRequest( }); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts index cc87545919b6e..b66248f9f5e6e 100644 --- a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts @@ -47,7 +47,6 @@ export async function supabaseApiRequest( } return await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts index ab9cbd3b4a7fe..ec53b79698c5f 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts @@ -54,7 +54,6 @@ export async function surveyMonkeyApiRequest( return await this.helpers.requestOAuth2?.call(this, 'surveyMonkeyOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts b/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts index 209d8e7fee78e..13096d6962bca 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/transport/index.ts @@ -36,7 +36,6 @@ export async function apiRequest( try { return await this.helpers.httpRequest(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts index f314b7aa926e7..d01e36cdd4a21 100644 --- a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function getAuthorization( return response.auth_token; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -81,7 +80,6 @@ export async function taigaApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts index 88c0888e0003e..5c8a836926db2 100644 --- a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts @@ -42,7 +42,6 @@ export async function tapfiliateApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts index f5c86f8273bac..cbffe21d5f06d 100644 --- a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts @@ -223,7 +223,6 @@ export async function apiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Todoist/GenericFunctions.ts b/packages/nodes-base/nodes/Todoist/GenericFunctions.ts index e2c3d632f5c9d..fb8cfc9bbad68 100644 --- a/packages/nodes-base/nodes/Todoist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Todoist/GenericFunctions.ts @@ -43,7 +43,6 @@ export async function todoistApiRequest( const credentialType = authentication === 'apiKey' ? 'todoistApi' : 'todoistOAuth2Api'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -71,7 +70,6 @@ export async function todoistSyncRequest( const credentialType = authentication === 'oAuth2' ? 'todoistOAuth2Api' : 'todoistApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts index 20de63a2f485e..48b018a21577c 100644 --- a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts @@ -48,7 +48,6 @@ export async function togglApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts b/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts index 41cb7f4bb9ca6..fcfcf87846f0d 100644 --- a/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts +++ b/packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts @@ -69,7 +69,6 @@ export class TogglTrigger implements INodeType { timeEntries = await togglApiRequest.call(this, 'GET', endpoint, {}, qs); webhookData.lastTimeChecked = qs.end_date; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } if (Array.isArray(timeEntries) && timeEntries.length !== 0) { diff --git a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts index ccd0d1d093800..b089998eb812c 100644 --- a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function travisciApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twist/GenericFunctions.ts b/packages/nodes-base/nodes/Twist/GenericFunctions.ts index a7bc07c3f01bf..64a5f803b23f5 100644 --- a/packages/nodes-base/nodes/Twist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twist/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function twistApiRequest( try { return await this.helpers.requestOAuth2.call(this, 'twistOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts index 42539f6e2e0bb..40a19fea00718 100644 --- a/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twitter/V1/GenericFunctions.ts @@ -37,7 +37,6 @@ export async function twitterApiRequest( } return await this.helpers.requestOAuth1.call(this, 'twitterOAuth1Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts b/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts index 3cb36a3840f72..33f238add0b2a 100644 --- a/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twitter/V2/GenericFunctions.ts @@ -52,7 +52,6 @@ export async function twitterApiRequest( } else if (error.errors && error.error?.errors[0].message.includes('must be ')) { throw new NodeOperationError(this.getNode(), error.error.errors[0].message as string); } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts index f71e8f58b012a..f7262b7a839f5 100644 --- a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts @@ -64,7 +64,6 @@ export async function apiRequest( return await this.helpers.requestOAuth2.call(this, 'typeformOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts index 5855842304a37..23c0b1d8c62a8 100644 --- a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts @@ -53,7 +53,6 @@ export async function unleashedApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts index 83281f3d19f84..1c73b029fddd8 100644 --- a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts @@ -35,7 +35,6 @@ export async function upleadApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts index 3f2c78d9b90b4..308c1c4a07154 100644 --- a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function uptimeRobotApiRequest( } return responseData; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index b4f19d886f7b0..933f8175ccf88 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -62,7 +62,6 @@ export async function venafiApiRequest( options, ); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vero/GenericFunctions.ts b/packages/nodes-base/nodes/Vero/GenericFunctions.ts index ae982ca88add9..51df117aa1382 100644 --- a/packages/nodes-base/nodes/Vero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vero/GenericFunctions.ts @@ -38,7 +38,6 @@ export async function veroApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vero/Vero.node.ts b/packages/nodes-base/nodes/Vero/Vero.node.ts index 3ddeb32c9a801..d4814263037fe 100644 --- a/packages/nodes-base/nodes/Vero/Vero.node.ts +++ b/packages/nodes-base/nodes/Vero/Vero.node.ts @@ -103,7 +103,6 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', '/users/track', body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -118,7 +117,6 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'PUT', '/users/reidentify', body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -137,7 +135,6 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', `/users/${operation}`, body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -158,7 +155,6 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'PUT', '/users/tags/edit', body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -216,7 +212,6 @@ export class Vero implements INodeType { try { responseData = await veroApiRequest.call(this, 'POST', '/events/track', body); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Vonage/GenericFunctions.ts b/packages/nodes-base/nodes/Vonage/GenericFunctions.ts index 1cd5ceb2b93a1..41618f755c926 100644 --- a/packages/nodes-base/nodes/Vonage/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vonage/GenericFunctions.ts @@ -36,7 +36,6 @@ export async function vonageApiRequest( } return await this.helpers.request.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts b/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts index 5846bc3ab2831..b50c9adad9e20 100644 --- a/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/WhatsApp/GenericFunctions.ts @@ -35,7 +35,6 @@ async function appAccessTokenRead( try { return await this.helpers.httpRequest.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } @@ -65,7 +64,6 @@ async function whatsappApiRequest( try { return await this.helpers.httpRequest.call(this, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Wise/GenericFunctions.ts b/packages/nodes-base/nodes/Wise/GenericFunctions.ts index 3befba1c79a41..8742dccd0125a 100644 --- a/packages/nodes-base/nodes/Wise/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wise/GenericFunctions.ts @@ -67,7 +67,6 @@ export async function wiseApiRequest( response = await this.helpers.httpRequest(options); } catch (error) { delete error.config; - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts index f8f372d22c845..ac0feb564cd77 100644 --- a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function wordpressApiRequest( const credentialType = 'wordpressApi'; return await this.helpers.requestWithAuthentication.call(this, credentialType, options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Workable/GenericFunctions.ts b/packages/nodes-base/nodes/Workable/GenericFunctions.ts index 1f835d54e3137..8b6dbc7eaeb71 100644 --- a/packages/nodes-base/nodes/Workable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Workable/GenericFunctions.ts @@ -39,7 +39,6 @@ export async function workableApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Xero/GenericFunctions.ts b/packages/nodes-base/nodes/Xero/GenericFunctions.ts index 56a17fce6778e..c1d7d372286e7 100644 --- a/packages/nodes-base/nodes/Xero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Xero/GenericFunctions.ts @@ -41,7 +41,6 @@ export async function xeroApiRequest( } return await this.helpers.requestOAuth2.call(this, 'xeroOAuth2Api', options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Yourls/GenericFunctions.ts b/packages/nodes-base/nodes/Yourls/GenericFunctions.ts index e7a134ee059a7..c847c0714d6e7 100644 --- a/packages/nodes-base/nodes/Yourls/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Yourls/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function yourlsApiRequest( return response; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts index b60be8857ffa5..aad3fa3d84917 100644 --- a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts @@ -79,7 +79,6 @@ export async function zammadApiRequest( error.error.error = 'An entity with this name already exists.'; } - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts index 2a63a0089de3d..337e8f3d19f84 100644 --- a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts +++ b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts @@ -477,7 +477,6 @@ export class Zendesk implements INodeType { ); responseData = responseData.ticket; } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index ddeb83220d5f6..e02bbf642ac5d 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -44,7 +44,6 @@ export async function zoomApiRequest( return await this.helpers.requestOAuth2.call(this, 'zoomOAuth2Api', options); } } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } diff --git a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts index 6b7470b70aa5b..12ef28ab5b329 100644 --- a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts @@ -52,7 +52,6 @@ export async function zulipApiRequest( try { return await this.helpers.request(options); } catch (error) { - if (error instanceof NodeApiError) throw error; throw new NodeApiError(this.getNode(), error as JsonObject); } } From 916b1025adca5e3bde098a6b873e39ef56ce7cf8 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 09:49:56 +0300 Subject: [PATCH 3/6] disable nodeApi and nodeOperation errors rewraping and option to enable it --- packages/workflow/src/errors/node-api.error.ts | 8 +++++++- packages/workflow/src/errors/node-operation.error.ts | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/workflow/src/errors/node-api.error.ts b/packages/workflow/src/errors/node-api.error.ts index 0819e678761d5..8646c42a406d6 100644 --- a/packages/workflow/src/errors/node-api.error.ts +++ b/packages/workflow/src/errors/node-api.error.ts @@ -31,6 +31,7 @@ export interface NodeOperationErrorOptions { messageMapping?: { [key: string]: string }; // allows to pass custom mapping for error messages scoped to a node functionality?: Functionality; type?: string; + allowRewraping?: boolean; } interface NodeApiErrorOptions extends NodeOperationErrorOptions { @@ -113,7 +114,7 @@ const STATUS_CODE_MESSAGES: IStatusCodeMessages = { * with an HTTP error code, an error message and a description. */ export class NodeApiError extends NodeError { - httpCode: string | null; + httpCode: string | null = null; // eslint-disable-next-line complexity constructor( @@ -129,8 +130,13 @@ export class NodeApiError extends NodeError { level, functionality, messageMapping, + allowRewraping, }: NodeApiErrorOptions = {}, ) { + if (errorResponse instanceof NodeApiError && !allowRewraping) { + return errorResponse; + } + super(node, errorResponse); this.addToMessages(errorResponse.message as string); diff --git a/packages/workflow/src/errors/node-operation.error.ts b/packages/workflow/src/errors/node-operation.error.ts index 2fdfa9688425a..08df2d209f46d 100644 --- a/packages/workflow/src/errors/node-operation.error.ts +++ b/packages/workflow/src/errors/node-operation.error.ts @@ -13,9 +13,13 @@ export class NodeOperationError extends NodeError { error: Error | string | JsonObject, options: NodeOperationErrorOptions = {}, ) { + if (error instanceof NodeOperationError && !options.allowRewraping) { + return error; + } if (typeof error === 'string') { error = new Error(error); } + super(node, error); if (error instanceof NodeError && error?.messages?.length) { From dfb8f987dcf8e5cf83ab8798c8888ecbd0680e53 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 10:03:34 +0300 Subject: [PATCH 4/6] test fix --- packages/workflow/test/errors/node.error.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/workflow/test/errors/node.error.test.ts b/packages/workflow/test/errors/node.error.test.ts index 3bf7dc20a6112..c7a6e82eb02a9 100644 --- a/packages/workflow/test/errors/node.error.test.ts +++ b/packages/workflow/test/errors/node.error.test.ts @@ -9,8 +9,8 @@ describe('NodeError', () => { it('should update re-wrapped error level and message', () => { const apiError = new NodeApiError(node, { message: 'Some error happened', code: 500 }); const opsError = new NodeOperationError(node, mock(), { message: 'Some operation failed' }); - const wrapped1 = new NodeOperationError(node, apiError); - const wrapped2 = new NodeOperationError(node, opsError); + const wrapped1 = new NodeOperationError(node, apiError, { allowRewraping: true }); + const wrapped2 = new NodeOperationError(node, opsError, { allowRewraping: true }); expect(wrapped1.level).toEqual('error'); expect(wrapped1.message).toEqual('The service was not able to process your request'); From 6e9cc6d3dd25b6e9f739923124bb42335ef41976 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 10:04:58 +0300 Subject: [PATCH 5/6] type fix --- packages/workflow/src/errors/node-api.error.ts | 4 ++-- packages/workflow/src/errors/node-operation.error.ts | 2 +- packages/workflow/test/errors/node.error.test.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/workflow/src/errors/node-api.error.ts b/packages/workflow/src/errors/node-api.error.ts index 8646c42a406d6..99ac0c19c9620 100644 --- a/packages/workflow/src/errors/node-api.error.ts +++ b/packages/workflow/src/errors/node-api.error.ts @@ -31,7 +31,7 @@ export interface NodeOperationErrorOptions { messageMapping?: { [key: string]: string }; // allows to pass custom mapping for error messages scoped to a node functionality?: Functionality; type?: string; - allowRewraping?: boolean; + allowRewrapping?: boolean; } interface NodeApiErrorOptions extends NodeOperationErrorOptions { @@ -130,7 +130,7 @@ export class NodeApiError extends NodeError { level, functionality, messageMapping, - allowRewraping, + allowRewrapping: allowRewraping, }: NodeApiErrorOptions = {}, ) { if (errorResponse instanceof NodeApiError && !allowRewraping) { diff --git a/packages/workflow/src/errors/node-operation.error.ts b/packages/workflow/src/errors/node-operation.error.ts index 08df2d209f46d..05ed020ac7c8d 100644 --- a/packages/workflow/src/errors/node-operation.error.ts +++ b/packages/workflow/src/errors/node-operation.error.ts @@ -13,7 +13,7 @@ export class NodeOperationError extends NodeError { error: Error | string | JsonObject, options: NodeOperationErrorOptions = {}, ) { - if (error instanceof NodeOperationError && !options.allowRewraping) { + if (error instanceof NodeOperationError && !options.allowRewrapping) { return error; } if (typeof error === 'string') { diff --git a/packages/workflow/test/errors/node.error.test.ts b/packages/workflow/test/errors/node.error.test.ts index c7a6e82eb02a9..156da4016ec4f 100644 --- a/packages/workflow/test/errors/node.error.test.ts +++ b/packages/workflow/test/errors/node.error.test.ts @@ -9,8 +9,8 @@ describe('NodeError', () => { it('should update re-wrapped error level and message', () => { const apiError = new NodeApiError(node, { message: 'Some error happened', code: 500 }); const opsError = new NodeOperationError(node, mock(), { message: 'Some operation failed' }); - const wrapped1 = new NodeOperationError(node, apiError, { allowRewraping: true }); - const wrapped2 = new NodeOperationError(node, opsError, { allowRewraping: true }); + const wrapped1 = new NodeOperationError(node, apiError, { allowRewrapping: true }); + const wrapped2 = new NodeOperationError(node, opsError, { allowRewrapping: true }); expect(wrapped1.level).toEqual('error'); expect(wrapped1.message).toEqual('The service was not able to process your request'); From 0cb62a12cad19aa3f41ec3f07b456fb17ae97fc1 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 5 Jun 2024 13:06:24 +0300 Subject: [PATCH 6/6] removed allowRewrapping option --- packages/workflow/src/errors/node-api.error.ts | 4 +--- packages/workflow/src/errors/node-operation.error.ts | 2 +- packages/workflow/test/errors/node.error.test.ts | 12 ++++-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/workflow/src/errors/node-api.error.ts b/packages/workflow/src/errors/node-api.error.ts index 99ac0c19c9620..56020fc6784f0 100644 --- a/packages/workflow/src/errors/node-api.error.ts +++ b/packages/workflow/src/errors/node-api.error.ts @@ -31,7 +31,6 @@ export interface NodeOperationErrorOptions { messageMapping?: { [key: string]: string }; // allows to pass custom mapping for error messages scoped to a node functionality?: Functionality; type?: string; - allowRewrapping?: boolean; } interface NodeApiErrorOptions extends NodeOperationErrorOptions { @@ -130,10 +129,9 @@ export class NodeApiError extends NodeError { level, functionality, messageMapping, - allowRewrapping: allowRewraping, }: NodeApiErrorOptions = {}, ) { - if (errorResponse instanceof NodeApiError && !allowRewraping) { + if (errorResponse instanceof NodeApiError) { return errorResponse; } diff --git a/packages/workflow/src/errors/node-operation.error.ts b/packages/workflow/src/errors/node-operation.error.ts index 05ed020ac7c8d..c4c8c780b1810 100644 --- a/packages/workflow/src/errors/node-operation.error.ts +++ b/packages/workflow/src/errors/node-operation.error.ts @@ -13,7 +13,7 @@ export class NodeOperationError extends NodeError { error: Error | string | JsonObject, options: NodeOperationErrorOptions = {}, ) { - if (error instanceof NodeOperationError && !options.allowRewrapping) { + if (error instanceof NodeOperationError) { return error; } if (typeof error === 'string') { diff --git a/packages/workflow/test/errors/node.error.test.ts b/packages/workflow/test/errors/node.error.test.ts index 156da4016ec4f..7d0783a65c70c 100644 --- a/packages/workflow/test/errors/node.error.test.ts +++ b/packages/workflow/test/errors/node.error.test.ts @@ -9,14 +9,10 @@ describe('NodeError', () => { it('should update re-wrapped error level and message', () => { const apiError = new NodeApiError(node, { message: 'Some error happened', code: 500 }); const opsError = new NodeOperationError(node, mock(), { message: 'Some operation failed' }); - const wrapped1 = new NodeOperationError(node, apiError, { allowRewrapping: true }); - const wrapped2 = new NodeOperationError(node, opsError, { allowRewrapping: true }); + const wrapped1 = new NodeOperationError(node, apiError); + const wrapped2 = new NodeOperationError(node, opsError); - expect(wrapped1.level).toEqual('error'); - expect(wrapped1.message).toEqual('The service was not able to process your request'); - expect(wrapped1.tags).toEqual(expect.objectContaining({ reWrapped: true })); - expect(wrapped2.level).toEqual('error'); - expect(wrapped2.message).toEqual('Some operation failed'); - expect(wrapped2.tags).toEqual(expect.objectContaining({ reWrapped: true })); + expect(wrapped1).toEqual(apiError); + expect(wrapped2).toEqual(opsError); }); });