mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 12:11:13 -05:00
Approve database migration
This commit is contained in:
@@ -48,15 +48,19 @@ export class AdminErrorBoundary extends Component<AdminErrorBoundaryProps, Admin
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
// Generate error ID for user reference
|
||||
const errorId = crypto.randomUUID();
|
||||
|
||||
logger.error('Admin panel error caught by boundary', {
|
||||
section: this.props.section || 'unknown',
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
componentStack: errorInfo.componentStack,
|
||||
severity: 'high', // Admin errors are high priority
|
||||
errorId,
|
||||
});
|
||||
|
||||
this.setState({ errorInfo });
|
||||
this.setState({ errorInfo, error: { ...error, errorId } as any });
|
||||
}
|
||||
|
||||
handleRetry = () => {
|
||||
@@ -107,6 +111,11 @@ export class AdminErrorBoundary extends Component<AdminErrorBoundaryProps, Admin
|
||||
<p className="text-sm">
|
||||
{this.state.error?.message || 'An unexpected error occurred in the admin panel'}
|
||||
</p>
|
||||
{(this.state.error as any)?.errorId && (
|
||||
<p className="text-xs font-mono bg-destructive/10 px-2 py-1 rounded">
|
||||
Reference ID: {((this.state.error as any).errorId as string).slice(0, 8)}
|
||||
</p>
|
||||
)}
|
||||
<p className="text-xs text-muted-foreground">
|
||||
This error has been logged. If the problem persists, please contact support.
|
||||
</p>
|
||||
|
||||
@@ -49,15 +49,19 @@ export class EntityErrorBoundary extends Component<EntityErrorBoundaryProps, Ent
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
// Generate error ID for user reference
|
||||
const errorId = crypto.randomUUID();
|
||||
|
||||
logger.error('Entity page error caught by boundary', {
|
||||
entityType: this.props.entityType,
|
||||
entitySlug: this.props.entitySlug,
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
componentStack: errorInfo.componentStack,
|
||||
errorId,
|
||||
});
|
||||
|
||||
this.setState({ errorInfo });
|
||||
this.setState({ errorInfo, error: { ...error, errorId } as any });
|
||||
}
|
||||
|
||||
handleRetry = () => {
|
||||
@@ -127,6 +131,11 @@ export class EntityErrorBoundary extends Component<EntityErrorBoundaryProps, Ent
|
||||
<p className="text-sm">
|
||||
{this.state.error?.message || `An unexpected error occurred while loading this ${entityLabel.toLowerCase()}`}
|
||||
</p>
|
||||
{(this.state.error as any)?.errorId && (
|
||||
<p className="text-xs font-mono bg-destructive/10 px-2 py-1 rounded">
|
||||
Reference ID: {((this.state.error as any).errorId as string).slice(0, 8)}
|
||||
</p>
|
||||
)}
|
||||
<p className="text-xs text-muted-foreground">
|
||||
This might be due to:
|
||||
</p>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, Route
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
// Generate error ID for user reference
|
||||
const errorId = crypto.randomUUID();
|
||||
|
||||
// Critical: Route-level error - highest priority logging
|
||||
logger.error('Route-level error caught by boundary', {
|
||||
error: error.message,
|
||||
@@ -50,7 +53,10 @@ export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, Route
|
||||
componentStack: errorInfo.componentStack,
|
||||
url: window.location.href,
|
||||
severity: 'critical',
|
||||
errorId,
|
||||
});
|
||||
|
||||
this.setState({ error: { ...error, errorId } as any });
|
||||
}
|
||||
|
||||
handleReload = () => {
|
||||
@@ -78,11 +84,18 @@ export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, Route
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{import.meta.env.DEV && this.state.error && (
|
||||
<div className="p-3 bg-muted rounded-lg">
|
||||
<p className="text-xs font-mono text-muted-foreground">
|
||||
{this.state.error.message}
|
||||
</p>
|
||||
{this.state.error && (
|
||||
<div className="p-3 bg-muted rounded-lg space-y-2">
|
||||
{import.meta.env.DEV && (
|
||||
<p className="text-xs font-mono text-muted-foreground">
|
||||
{this.state.error.message}
|
||||
</p>
|
||||
)}
|
||||
{(this.state.error as any)?.errorId && (
|
||||
<p className="text-xs font-mono bg-destructive/10 px-2 py-1 rounded">
|
||||
Reference ID: {((this.state.error as any).errorId as string).slice(0, 8)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user