Two independent bugs were hiding the actual cause of a failed Cashu
swap/verify behind "mint returned 422 Unprocessable Entity with no
further detail":
- describe_mint_error_body() only read `detail` as a plain string, but
FastAPI (which most mint implementations, including Nutshell, are
built on) reports validation errors as an array of {loc, msg, type}
objects. That shape fell through to the generic fallback even when
the mint sent a specific reason.
- The warn!() logging a failed swap in ecash.rs used `{}` (top-level
message only) instead of `{:#}`, discarding the raw mint body that
mint_error() already attaches to the error's cause chain for exactly
this purpose.
Confirmed live against mint.minibits.cash (2026-09-18): a real 422
during a peer-to-peer ecash payment logged nothing actionable on
either end because of this pair of bugs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>