Skip to content

fix(swap): surface actual errors instead of catch-all Network error#112

Merged
passandscore merged 3 commits intomainfrom
network-error
Apr 13, 2026
Merged

fix(swap): surface actual errors instead of catch-all Network error#112
passandscore merged 3 commits intomainfrom
network-error

Conversation

@passandscore
Copy link
Copy Markdown
Contributor

@passandscore passandscore commented Apr 13, 2026

Summary

  • On-chain reverts were shown as "Network error" because RPCError used the literal message "RPC Error", which matched the network substring catch-all in mapErrorMessage
  • Added buildRevertMessage() to extract tx hash, block, gas used, and revert reason from the receipt into a human-readable message
  • mapErrorMessage now returns null for RPCError with a receipt so the actual message flows through unmodified
  • Network errors now surface the real error (e.g. HttpRequestError: status 503) instead of generic "check your internet" boilerplate
  • Covers all three swap paths: intent (permit), ETH, and WETH wrap/unwrap

…Network error"

On-chain reverts were shown as "Network error" because RPCError used the
literal message "RPC Error", which matched the network substring catch-all.
Network errors now surface the real error (e.g. status 503, endpoint URL)
instead of generic "check your internet" boilerplate.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fastprotocolapp Ready Ready Preview, Comment Apr 13, 2026 2:52pm

Request Review

@passandscore passandscore merged commit 741186c into main Apr 13, 2026
3 checks passed
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.

1 participant