Skip to content

feat(RepaymentVisualizer): add ErrorBoundary wrapper with retry action (Closes #852) - #901

Open
waterWang wants to merge 1 commit into
Creditra:mainfrom
waterWang:feat/repayment-visualizer-error-boundary-retry-852
Open

feat(RepaymentVisualizer): add ErrorBoundary wrapper with retry action (Closes #852)#901
waterWang wants to merge 1 commit into
Creditra:mainfrom
waterWang:feat/repayment-visualizer-error-boundary-retry-852

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a component-level ErrorBoundary around the RepaymentVisualizer chart with a Try Again button that resets the error boundary state and re-renders the component without a full page reload.

Changes

ErrorBoundary (src/components/ErrorBoundary.tsx)

  • Added resetError() method to the class component — sets hasError: false and error: undefined so the boundary re-renders its children
  • Added onRetry callback prop to the ErrorPage fallback UI
  • Added Try Again button (primary action) that calls resetError()
  • Moved Go Back to secondary button style

RepaymentVisualizer page (src/pages/RepaymentVisualizer.tsx)

  • Wrapped the RepaymentVisualizer component in a dedicated <ErrorBoundary> so render errors in the chart are caught locally with a retry-able fallback

Tests (src/components/ErrorBoundary.test.tsx)

  • Added resets error state and re-renders children on Try Again test covering the retry recovery flow

Closes #852

Closes Creditra#852)

- Add resetError() method to ErrorBoundary class component that resets
  error state and re-renders children without a full page reload
- Add 'Try Again' button to ErrorPage fallback that calls resetError()
- Wrap RepaymentVisualizerPage with a component-level ErrorBoundary so
  render errors in the chart are caught with a retry-able fallback
- Update ErrorBoundary tests to cover the retry recovery flow
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.

Polish RepaymentVisualizer error-boundary fallback UI [b#039]

1 participant