Skip to content

Add global and route-level error boundaries with production error logging#377

Open
Tomoya0k wants to merge 3 commits into
Bitcoindefi:mainfrom
Tomoya0k:fix/error-boundary-issue-210
Open

Add global and route-level error boundaries with production error logging#377
Tomoya0k wants to merge 3 commits into
Bitcoindefi:mainfrom
Tomoya0k:fix/error-boundary-issue-210

Conversation

@Tomoya0k

@Tomoya0k Tomoya0k commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a global recovery UI for unhandled React errors and route-level error boundaries for major App Router sections.

What changed

  • added app/global-error.tsx to handle unhandled app-level React errors
  • added a friendly recovery screen with:
    • user-friendly message
    • developer-only technical details in development
    • Try again and Reload page actions
    • issue reporting link
  • added production error logging to .data/error-log.json
  • added POST /api/errors/report to persist client-reported errors on the server
  • added route-level error boundaries for:
    • /map
    • /leaderboard
    • /admin
  • extracted shared route error UI into a reusable component to avoid duplication
  • extracted client-side error reporting into a shared utility
  • updated error log entry IDs to use crypto.randomUUID()

Notes

  • the original issue mentioned /registry, but that route does not exist in the current repo state
  • /admin was used instead as a major real route with equivalent importance
  • the global error handling is implemented using Next.js App Router's native app/global-error.tsx mechanism

Closes #210

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error boundary: catch unhandled React errors and show a friendly recovery UI

1 participant