Skip to content

Add error boundary components and global error handling #45

@Anuoluwapo25

Description

@Anuoluwapo25

Overview

Unhandled errors currently crash the entire React tree. Add proper error boundaries so failures are contained and recoverable.

Acceptance Criteria

  • ErrorBoundary component at src/components/ErrorBoundary.tsx
  • Wraps each major page section (not just the root)
  • Shows friendly error UI: "Something went wrong" + retry button + option to report
  • Catches and logs contract invocation errors with user-friendly messages:
    • Insufficient balance → "You don't have enough LRN for this action"
    • Network mismatch → "Please switch to Testnet in your wallet"
    • User rejected tx → "Transaction cancelled"
  • TanStack Query onError global handler configured
  • No raw error objects ever shown to users

Notes

  • React 19 has new use + Suspense patterns — follow current patterns in the codebase
  • Add src/util/error.ts with error classification helpers

Metadata

Metadata

Assignees

Labels

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