import React, { Component, ErrorInfo, ReactNode } from 'react'; import { ShieldAlert, Terminal } from 'lucide-react'; interface Props { children: ReactNode } interface State { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null } export class DebugGuard extends Component { constructor(props: Props) { super(props); this.state = { hasError: false, error: null, errorInfo: null }; } static getDerivedStateFromError(error: Error): State { return { hasError: true, error, errorInfo: null }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { this.setState({ error, errorInfo }); console.error("SYSTEM FRACTURE:", error, errorInfo); } render() { if (this.state.hasError) { return (

SYSTEM FRACTURE

Error Log

{this.state.error?.toString()}

{this.state.errorInfo?.componentStack}
); } return this.props.children; } }