Added Error Boundary (#649)

* Added Error Boundary

* Test improvements

* Introduced useDevLogger

* Updated Cypress to latest and aligned the tests

* Added eslint-enable

* Set allowCypressEnv: false for security reasons.
This commit is contained in:
yuri-sakharov
2026-02-08 20:22:04 +02:00
committed by GitHub
parent ea7f8722ac
commit f647a3db03
16 changed files with 763 additions and 536 deletions
@@ -0,0 +1,33 @@
import type { FallbackProps } from "react-error-boundary";
import GlobalErrorModal from "../modal/GlobalErrorModal";
import { useDevLogger } from "../../hooks/useDevLogger";
/**
* Error fallback component for React Error Boundary
* Uses the existing GlobalErrorModal for consistent error display
* @param error - The error that was caught
* @param resetErrorBoundary - Function to reset the error boundary state
*/
const ErrorFallback = ({ error, resetErrorBoundary }: FallbackProps) => {
useDevLogger(error);
const handleClose = () => {
// Reset the error boundary to allow the component tree to re-render
resetErrorBoundary();
};
return (
<GlobalErrorModal
isOpen={true}
onClose={handleClose}
titleText="Application Error"
contentText={
error instanceof Error
? error.message
: "An unexpected error occurred. Please try again."
}
/>
);
};
export default ErrorFallback;