Files
thrilltrack-explorer/src/test-error-logging.tsx
gpt-engineer-app[bot] ec7fae3d86 Fix and test error logging
2025-11-03 22:19:27 +00:00

38 lines
1.0 KiB
TypeScript

/**
* Temporary test component to verify error logging system
* Delete this file after testing
*/
import { Button } from '@/components/ui/button';
import { handleError } from '@/lib/errorHandler';
import { supabase } from '@/lib/supabaseClient';
import { useAuth } from '@/hooks/useAuth';
export function TestErrorLogging() {
const { user } = useAuth();
const testError = () => {
try {
throw new Error('Test error for logging system verification');
} catch (error) {
handleError(error, {
action: 'Test Error Logging',
userId: user?.id,
metadata: { test: true }
});
}
};
const testApiCall = async () => {
// This will generate breadcrumbs via the wrapped client
await supabase.from('parks').select('id').limit(1);
};
return (
<div className="p-4 space-y-4">
<h2 className="text-xl font-bold">Error Logging Test</h2>
<Button onClick={testError}>Generate Test Error</Button>
<Button onClick={testApiCall} variant="outline">Test API Breadcrumbs</Button>
</div>
);
}