diff --git a/src/components/ErrorBoundary.jsx b/src/components/ErrorBoundary.jsx index b74b6e5..7842981 100644 --- a/src/components/ErrorBoundary.jsx +++ b/src/components/ErrorBoundary.jsx @@ -8,12 +8,16 @@ class ErrorBoundary extends React.Component { error: null, errorInfo: null }; + console.log('ErrorBoundary constructed'); } static getDerivedStateFromError(error) { - console.log('ErrorBoundary getDerivedStateFromError:', error); - console.log('Error type:', error?.constructor?.name); - console.log('Error message:', error?.message); + console.log('ErrorBoundary getDerivedStateFromError:', { + error, + type: error?.constructor?.name, + message: error?.message, + stack: error?.stack + }); if (error && !error.message?.includes('Failed to load resource') && @@ -25,8 +29,13 @@ class ErrorBoundary extends React.Component { } componentDidCatch(error, errorInfo) { - console.log('ErrorBoundary componentDidCatch:', error); - console.log('Component stack:', errorInfo?.componentStack); + console.log('ErrorBoundary componentDidCatch:', { + error, + type: error?.constructor?.name, + message: error?.message, + stack: error?.stack, + componentStack: errorInfo?.componentStack + }); if (error && !error.message?.includes('Failed to load resource') && @@ -39,7 +48,22 @@ class ErrorBoundary extends React.Component { } } + componentDidMount() { + console.log('ErrorBoundary mounted'); + } + + componentDidUpdate() { + console.log('ErrorBoundary updated', { + hasError: this.state.hasError, + error: this.state.error + }); + } + render() { + console.log('ErrorBoundary rendering', { + hasError: this.state.hasError + }); + if (this.state.hasError) { return (
Please refresh the page or try again later.
+ {process.env.NODE_ENV === 'development' && ( ++ {this.state.error && this.state.error.toString()} ++ )}