Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent NodeApiError rewraping (no-changelog) #9627

Conversation

michael-radency
Copy link
Contributor

@michael-radency michael-radency added node/improvement New feature or request n8n team Authored by the n8n team node/issue Issue with a node labels Jun 5, 2024
@@ -63,6 +63,7 @@ export async function activeCampaignApiRequest(
return responseData[dataKey] as IDataObject;
}
} catch (error) {
if (error instanceof NodeApiError) throw error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there must be a better way to do this instead of having to repeat this so many times.
perhaps we can try moving this check inside the NodeApiError constructor.

Copy link
Contributor Author

@michael-radency michael-radency Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider this, but what if we actually want to re-wrap error? and if we decide to do that for NodeApiError we probably want same policy for other error types
Despite a lot of files changed this would be less invasive and better for performance, as it's simple check

updated pr to disable errors re-wrapping

…do-not-re-wrap-error-in-nodes-api-request-function
Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last time we did this, it was done in the NodeError, and that caused a lot of issues. I'm hoping that since these error classes aren't extended, this change doesn't cause those same issues 🤞🏽

Copy link

cypress bot commented Jun 5, 2024

2 flaky tests on run #5320 ↗︎

0 356 0 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 michael-radency 🗃️ e2e/*
Project: n8n Commit: b941825f87
Status: Passed Duration: 05:24 💡
Started: Jun 5, 2024 11:09 AM Ended: Jun 5, 2024 11:14 AM
Flakiness  cypress/e2e/5-ndv.cy.ts • 2 flaky tests

View Output Video

Test Artifacts
NDV > should retrieve remote options when non-required params throw errors Screenshots Video
NDV > Stop listening for trigger event from NDV Screenshots Video

Review all test suite changes for PR #9627 ↗︎

Copy link
Contributor

github-actions bot commented Jun 5, 2024

✅ All Cypress E2E specs passed

@michael-radency michael-radency merged commit 37531cd into master Jun 5, 2024
28 checks passed
@michael-radency michael-radency deleted the node-1392-do-not-re-wrap-error-in-nodes-api-request-function branch June 5, 2024 11:21
@janober
Copy link
Member

janober commented Jun 5, 2024

Got released with n8n@1.45.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request node/issue Issue with a node Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants