feat(RepaymentVisualizer): add ErrorBoundary wrapper with retry action (Closes #852) - #901
Open
waterWang wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
resetError()method to the class component — setshasError: falseanderror: undefinedso the boundary re-renders its childrenonRetrycallback prop to theErrorPagefallback UIresetError()RepaymentVisualizer page (src/pages/RepaymentVisualizer.tsx)
RepaymentVisualizercomponent in a dedicated<ErrorBoundary>so render errors in the chart are caught locally with a retry-able fallbackTests (src/components/ErrorBoundary.test.tsx)
resets error state and re-renders children on Try Againtest covering the retry recovery flowCloses #852