Implement Phase 3C error logging

This commit is contained in:
gpt-engineer-app[bot]
2025-11-04 19:39:55 +00:00
parent 162d288cb0
commit a9334c7a3a
13 changed files with 179 additions and 210 deletions

View File

@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
import { supabase } from '@/lib/supabaseClient';
import { useAuth } from '@/hooks/useAuth';
import { queryKeys } from '@/lib/queryKeys';
import { logger } from '@/lib/logger';
import { handleNonCriticalError } from '@/lib/errorHandler';
export type UserRole = 'admin' | 'moderator' | 'user' | 'superuser';
@@ -30,7 +30,10 @@ export function useUserRole() {
.eq('user_id', user.id);
if (error) {
logger.error('Error fetching user roles', { error, userId: user.id });
handleNonCriticalError(error, {
action: 'Fetch user roles',
userId: user.id,
});
return [];
}
@@ -51,7 +54,10 @@ export function useUserRole() {
.rpc('get_user_management_permissions', { _user_id: user.id });
if (error) {
logger.error('Error fetching user permissions', { error, userId: user.id });
handleNonCriticalError(error, {
action: 'Fetch user permissions',
userId: user.id,
});
return null;
}