Skip to content

feat(app): add app-wide error boundary#315

Open
onajidavid87-web wants to merge 1 commit into
tributary-protocol:mainfrom
onajidavid87-web:Add-an-app-wide-error-boundary-#148
Open

feat(app): add app-wide error boundary#315
onajidavid87-web wants to merge 1 commit into
tributary-protocol:mainfrom
onajidavid87-web:Add-an-app-wide-error-boundary-#148

Conversation

@onajidavid87-web

Copy link
Copy Markdown

Closes #148

What this changes
Adds a React Error Boundary at the root of the render tree to prevent uncaught runtime/render errors

Why

  • New ErrorBoundary class component wrapping the app outside <StrictMode>

  • Fallback UI shows the error message with "Try again" (resets boundary) and "Refresh page" recovery actions

  • Styled to match existing design system

  • 4 tests covering normal rendering, fallback display, reset, and error logging
    Checklist

  • cargo fmt --all and cargo clippy --all-targets -- -D warnings pass

  • cargo test passes

  • New behavior has tests

  • Linked issue, if there is one

Closes #148

Adds a React Error Boundary at the root of the render tree to prevent
uncaught runtime/render errors (e.g. the BigInt crash in tributary-protocol#266) from
blanking the entire UI.

- New `ErrorBoundary` class component wrapping the app outside `<StrictMode>`
- Fallback UI shows the error message with "Try again" (resets boundary)
  and "Refresh page" recovery actions
- Styled to match existing design system
- 4 tests covering normal rendering, fallback display, reset, and error logging

Closes tributary-protocol#148
@Spagero763

Copy link
Copy Markdown
Contributor

web fails to build: Cannot find module '@testing-library/react' in src/components/ErrorBoundary.test.tsx. Looks like the test file was added but the devDependency wasn't: npm install -D @testing-library/react in app/ and commit the updated package.json/package-lock.json.

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.

Add an app-wide error boundary

2 participants