Skip to content

Add Error Handling and User Feedback #19

Description

@Mrwicks00

Description

Implement comprehensive error handling and user feedback for all contract interactions.

Tasks

  • Create error message mapping for common contract errors:
    • "Submissions closed" → User-friendly message
    • "Voting closed" → User-friendly message
    • "Below min stake" → Show minimum stake amount
    • "Insufficient balance" → Show current balance
    • "User submissions limit" → Show max submissions
    • Transaction revert reasons
  • Add toast notifications for:
    • Transaction pending
    • Transaction success
    • Transaction failure
    • Contract errors
  • Display loading states during contract calls
  • Add retry logic for failed transactions
  • Show gas estimation errors before transaction
  • Handle network errors gracefully
  • Add error boundaries for React components

Files to Modify

  • All hooks that interact with contracts
  • frontend/lib/errorMessages.ts (new file - error message mapping)
  • frontend/components/ui/toast.tsx (enhance existing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersnot-paidThis issue or pull request already exists

    Type

    No type
    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