mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 18:11:12 -05:00
Fix remaining console statements
This commit is contained in:
@@ -13,19 +13,8 @@ interface RouteErrorBoundaryState {
|
||||
error: Error | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Route Error Boundary Component (P0 #5)
|
||||
*
|
||||
* Top-level error boundary that wraps all routes.
|
||||
* Last line of defense to prevent complete app crashes.
|
||||
*
|
||||
* Usage: Wrap Routes component in App.tsx
|
||||
* ```tsx
|
||||
* <RouteErrorBoundary>
|
||||
* <Routes>...</Routes>
|
||||
* </RouteErrorBoundary>
|
||||
* ```
|
||||
*/
|
||||
type ErrorWithId = Error & { errorId: string };
|
||||
|
||||
export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, RouteErrorBoundaryState> {
|
||||
constructor(props: RouteErrorBoundaryProps) {
|
||||
super(props);
|
||||
@@ -56,7 +45,7 @@ export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, Route
|
||||
errorId,
|
||||
});
|
||||
|
||||
this.setState({ error: { ...error, errorId } as any });
|
||||
this.setState({ error: { ...error, errorId } as ErrorWithId });
|
||||
}
|
||||
|
||||
handleReload = () => {
|
||||
@@ -91,9 +80,9 @@ export class RouteErrorBoundary extends Component<RouteErrorBoundaryProps, Route
|
||||
{this.state.error.message}
|
||||
</p>
|
||||
)}
|
||||
{(this.state.error as any)?.errorId && (
|
||||
{(this.state.error as ErrorWithId)?.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)}
|
||||
Reference ID: {(this.state.error as ErrorWithId).errorId.slice(0, 8)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user