Skip to content

UX: Generic 40x error when insufficient funds for stamp purchase #513

Description

@crtahlin

Problem

When attempting to purchase a postage stamp without sufficient xBZZ/xDAI funds, the UI displays a generic red popup with an unhelpful error message like "error 40x" (HTTP status code).

This provides no actionable information to the user about:

  • What went wrong
  • Why it failed
  • How to fix it

Expected Behavior

The error message should be user-friendly and actionable:

Example improved messages:

  • "Insufficient xBZZ balance to purchase stamp. You need X xBZZ but only have Y. [Add funds]"
  • "Insufficient xDAI for gas fees. You need approximately X xDAI. [Add funds]"
  • "Transaction failed: Not enough funds in wallet 0x... to complete stamp purchase."

Current Behavior

  • Red popup appears with generic "Error 40x" or similar HTTP status code
  • No indication that the issue is related to wallet balance
  • User has to guess what went wrong

Suggested Improvements

  1. Parse API error responses - The Bee API returns structured error messages. Parse and display these in human-readable form.

  2. Check balances before attempting purchase - Validate wallet has sufficient funds before sending the transaction, and show a clear message if not.

  3. Contextual error messages - Map common error scenarios to helpful messages:

    • Insufficient xBZZ → "Need more xBZZ for stamp"
    • Insufficient xDAI → "Need more xDAI for gas"
    • RPC error → "Blockchain connection issue"
    • Stamp depth/amount invalid → Specific validation message
  4. Include "next steps" - Each error should suggest what the user can do (e.g., link to faucet, show wallet address to fund, etc.)

Environment

  • Swarm Desktop version: 2.6.0
  • OS: macOS

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions