fix(wallet): translate Cashu NUT error codes into plain-language messages #132

Closed
ssmithx wants to merge 0 commits from cashu-error-messages into main
Collaborator

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

  • Rust formatting/clippy/tests pass when backend code changed.
  • Frontend type-check/build/tests pass when frontend code changed.
  • App manifests validate when app packaging changed.
  • Generated catalogs are updated when manifest-owned catalog fields changed.
  • Docs are updated for user-facing or developer-facing behavior changes.
  • No secrets, generated build outputs, local screenshots, or private host details are included.
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 <!-- What changed and why? --> ## Verification <!-- Commands run, devices tested, screenshots, or reason testing was not run. --> ## Checklist - [ ] Rust formatting/clippy/tests pass when backend code changed. - [ ] Frontend type-check/build/tests pass when frontend code changed. - [ ] App manifests validate when app packaging changed. - [ ] Generated catalogs are updated when manifest-owned catalog fields changed. - [ ] Docs are updated for user-facing or developer-facing behavior changes. - [ ] No secrets, generated build outputs, local screenshots, or private host details are included.
Collaborator

Closing: already merged in content. Merged on the pre-import lineage in e5612fff ("Merge PR #132: translate Cashu NUT error codes...") and carried into current main through the 2026-08-12 open-source initial import — the NUT-02/03/04/05 error-code translator is present in core/archipelago/src/wallet/mint_client.rs (e.g. 11001 -> "This ecash has already been redeemed - it can't be claimed twice."). Verified on current main; no further action needed.

Closing: already merged in content. Merged on the pre-import lineage in `e5612fff` ("Merge PR #132: translate Cashu NUT error codes...") and carried into current main through the 2026-08-12 open-source initial import — the NUT-02/03/04/05 error-code translator is present in core/archipelago/src/wallet/mint_client.rs (e.g. 11001 -> "This ecash has already been redeemed - it can't be claimed twice."). Verified on current main; no further action needed.
chaum closed this pull request 2026-08-30 18:00:30 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.