fix(wallet): translate Cashu NUT error codes into plain-language messages #132
Open
ssmithx
wants to merge 0 commits from
cashu-error-messages into main
pull from: cashu-error-messages
merge into: :main
:main
:gsd/phase-13-aiui-functional-conversational-node-control-and-content-surf
:feat/podsteadr-app-package
:fix/mesh-send-content-inline-federation-fallback
:cashu-error-messages
:rotate-release-root
:chore/aiui-monorepo-migration
:wip/phase-13-p13-02
:wip/phase-13-p13-01
:companion/0.5.27-clipboard-qr-restart
:fix/bitcoin-conf-conflict-crash-loop
:demo-build
:archy-hwconfig
:openwrt-enhancements
:a3-10-endpoint-fallback
:public-prelaunch
:release/1.7.115-prep
:fix/web-listener-ipv6
:fips-companion-5g-hardening
:fix/connection-accept-deadlock
:fix/demo-images-path-filter
:fix/companion-autologin-replay-intro
:networking-profits-dashboard
:identities-mobile-polish
:companion-qr-scan-fix
:companion-qr-pairing
:intro-reliability-video-perf
:login-bg-continuity
:audio-bottom-bar
:demo-intro-every-visit
:intro-entrance-fixes
:cloud-feedback-demo-content
:cloud-tabs-search
:ark-wallet-ui-demo
:demo-nginx-app-assets
:demo-ui-fixes
:ark-wallet-barkd
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Mint HTTP failures (swap/melt/mint-quote) were surfacing raw JSON bodies
like {"detail":"proofs already spent","code":11001} straight to the
user. Add a translator for the NUT-02/03/04/05 transaction-validation
error codes (10001-11017, 12001-12003; see
https://github.com/cashubtc/nuts/blob/main/error_codes.md) and layer it
onto the mint_client bail sites via anyhow context, so the top-level
message is actionable while the raw status/body stays available via
{:#} for logs. receive_token now surfaces the real reason (e.g. "This
ecash has already been redeemed") instead of a generic "Failed to
receive any proofs from token" when every mint in a token fails.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Summary
Verification
Checklist
Mint HTTP failures (swap/melt/mint-quote) were surfacing raw JSON bodies like {"detail":"proofs already spent","code":11001} straight to the user. Add a translator for the NUT-02/03/04/05 transaction-validation error codes (10001-11017, 12001-12003; see https://github.com/cashubtc/nuts/blob/main/error_codes.md) and layer it onto the mint_client bail sites via anyhow context, so the top-level message is actionable while the raw status/body stays available via {:#} for logs. receive_token now surfaces the real reason (e.g. "This ecash has already been redeemed") instead of a generic "Failed to receive any proofs from token" when every mint in a token fails. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.