mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 22:31:13 -05:00
feat: Implement comprehensive error logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useUnitPreferences } from '@/hooks/useUnitPreferences';
|
||||
import { handleNonCriticalError } from '@/lib/errorHandler';
|
||||
import { logger } from '@/lib/logger';
|
||||
import * as storage from '@/lib/localStorage';
|
||||
|
||||
@@ -26,7 +27,14 @@ export function useLocationAutoDetect() {
|
||||
autoDetectPreferences().then(() => {
|
||||
storage.setItem('location_detection_attempted', 'true');
|
||||
}).catch((error) => {
|
||||
logger.error('Failed to auto-detect location', { error });
|
||||
handleNonCriticalError(error, {
|
||||
action: 'Auto-detect user location',
|
||||
userId: user?.id,
|
||||
metadata: {
|
||||
autoDetectEnabled: preferences.auto_detect,
|
||||
context: 'initial_load'
|
||||
}
|
||||
});
|
||||
storage.setItem('location_detection_attempted', 'true');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user