fix(withdraw): map Rhino NoRouteFoundError to actionable route-not-found copy - #2656
fix(withdraw): map Rhino NoRouteFoundError to actionable route-not-found copy#2656abalinda wants to merge 1 commit into
Conversation
…und copy When Rhino can't route a pair, the backend surfaces the provider tag verbatim and the confirm screen showed the raw string. Map it to ROUTE_NOT_FOUND_ERROR in the shared calculate() catch so all three consumers (withdraw, pay-request, claim-xchain) inherit the copy the Confirm view already special-cases (Retry sends the user back to fix the input). Follow-up to api#1320 (TASK-21284).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe cross-chain transfer hook now maps ChangesCross-chain error handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
|
Code-analysis diffPainscore total: 7141.56 → 7141.78 (+0.22) 🆕 New findings (8)
✅ Resolved (8)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Companion to peanut-api-ts#1320 (TASK-21284). When Rhino cannot route a pair, the backend surfaces the provider tag (
NoRouteFoundError) verbatim and the withdraw confirm screen shows the raw string. Map it toROUTE_NOT_FOUND_ERRORin the sharedcalculate()catch, so all three consumers (withdraw, pay-request, claim-xchain) inherit the copy the Confirm view already special-cases — its Retry button callsonBack()for this constant, which returns the user to the amount input. No new UI code; one mapping line plus the hook's first test file.Task
Notion TASK-21284 — Fix Solana USDC withdrawal preview failure (DoD bullet 2: unsupported routes show a specific error and leave the user able to correct the input).
Risks / breaking changes
QA
useCrossChainTransfer.test.ts: NoRouteFoundError → ROUTE_NOT_FOUND_ERROR; any other message passes through verbatim.Screenshots: N/A (no new surface — the existing ErrorAlert renders different copy on an error path that today shows a raw provider string).
Design notes / accepted trade-offs
/code-review medium(1 finding, applied-as-follow-up): theROUTE_NOT_FOUND_ERROREnglish constant bypasses theclassifyError/next-intl localization path. Pre-existing pattern (same constant + equality check inConfirm.withdraw.view.tsxandClaim/Link/Initial.view.tsxbefore this PR); migrating it to aFriendlyErrorCodetouches the Confirm view'serror === ROUTE_NOT_FOUND_ERRORspecial-case, so it goes in a separate localization follow-up rather than this hotfix. No behavior regression — users previously saw a raw JSON blob.Summary by CodeRabbit