Skip to content

Fix: clean up 402 error description after API balance exposure removal (#230)#242

Merged
RapierCraft merged 1 commit into
mainfrom
fix/sync-balance-402-error-230
Jun 3, 2026
Merged

Fix: clean up 402 error description after API balance exposure removal (#230)#242
RapierCraft merged 1 commit into
mainfrom
fix/sync-balance-402-error-230

Conversation

@RapierCraft

Copy link
Copy Markdown
Owner

Summary

  • API PR #19971 removed exact dollar amounts from 402 insufficient_credits responses
  • The 402 error handler in the n8n node was injecting ${detail} into the description, which now produces a redundant/duplicated "Please top up" message
  • Removed the ${detail}. prefix from the 402 case — description now cleanly links to the billing page

Changes

  • nodes/AlterLab/AlterLab.node.ts: Remove ${detail}. from 402 error description in handleApiError

Testing

  • Trigger a 402 response and verify the error shows "Insufficient balance" with billing URL only
  • Verify 401, 403, 429 error cases still include detail in their descriptions

Closes #230
Implementation branch: fix/sync-balance-402-error-230
Base: main

API PR #19971 simplified the 402 insufficient_credits response detail to a
generic message. Injecting it into the n8n error description caused duplicate
"top up" messaging. Now the description links directly to the billing page.

@RapierCraft RapierCraft left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

APPROVED: commit cc74af5 after context-aware review (1 agent: General Security). 0 findings. Safe to merge.

Review scope: TypeScript error handler sync — 1 line removed from 402 description in handleApiError.

Checks passed:

  • Build: npm run build — clean
  • Prettier: unchanged
  • Secrets: none
  • Env vars: none
  • Integration: handleApiError is the sole 402 dispatcher, all resource callers unaffected
  • Security: No information disclosure concern — change removes redundant balance detail from user-facing error (consistent with API PR #19971 privacy intent)

@RapierCraft RapierCraft left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

APPROVED: commit cc74af5 after context-aware review (1 agent: General Security). 0 findings. Safe to merge.

@RapierCraft

Copy link
Copy Markdown
Owner Author

APPROVED: commit cc74af5 after context-aware review (1 agent: General Security). 0 findings. Safe to merge.

Checks: Build pass | Prettier pass | No secrets | No env vars | Integration verified | Security clean

@RapierCraft RapierCraft merged commit 5a7c159 into main Jun 3, 2026
3 checks passed
@RapierCraft

Copy link
Copy Markdown
Owner Author

PR Review Summary: #242 - Fix: clean up 402 error description after API balance exposure removal (#230)

Review Integrity

Reviewed commit: cc74af5 | Current HEAD: cc74af5 | Status: CURRENT

Verdict: APPROVED

Context-Aware Review

Domains: n8n node TypeScript | Agents: 1 (General Security — inline)

Integration Checks (Phase 2.5)

Code registration: PASS — node registered in package.json, handleApiError correctly dispatched from all resource handlers
SOPS deploy chain: N/A — no env vars
Purpose Regression Gate (7A): N/A — non-milestone PR

Risk Matrix

Category Risk Blocking? Confidence
TypeScript build None No CONFIRMED pass
Security None No CONFIRMED clean
Integration None No CONFIRMED intact

Findings

No findings.

Automated Checks

Check Result
npm run build PASS
Prettier PASS (unchanged)
Secrets detection CLEAN
Env var audit CLEAN
Builder contract scope Matches (1 file, 1 line)

Recommendation

Change is minimal, correct, and consistent with API PR #19971's intent to remove balance exposure from error responses. Merged.


Context-aware review complete. 1 agent + integration checks. 0 findings triaged. PR merged to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync: Scrape API modification (from #19971)

1 participant