mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-29 22:07:06 -05:00
Approve database migration
This commit is contained in:
@@ -49,15 +49,19 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
// Generate error ID for user reference
|
||||
const errorId = crypto.randomUUID();
|
||||
|
||||
// Log error with context
|
||||
logger.error('Component error caught by boundary', {
|
||||
context: this.props.context || 'unknown',
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
componentStack: errorInfo.componentStack,
|
||||
errorId,
|
||||
});
|
||||
|
||||
this.setState({ errorInfo });
|
||||
this.setState({ errorInfo, error: { ...error, errorId } as any });
|
||||
this.props.onError?.(error, errorInfo);
|
||||
}
|
||||
|
||||
@@ -101,6 +105,11 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
||||
<p className="text-sm mt-2">
|
||||
{this.state.error?.message || 'An unexpected error occurred'}
|
||||
</p>
|
||||
{(this.state.error as any)?.errorId && (
|
||||
<p className="text-xs mt-2 font-mono bg-destructive/10 px-2 py-1 rounded">
|
||||
Reference ID: {((this.state.error as any).errorId as string).slice(0, 8)}
|
||||
</p>
|
||||
)}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user