mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-30 06:27:06 -05:00
feat: Implement comprehensive error logging
This commit is contained in:
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { supabase } from '@/lib/supabaseClient';
|
||||
import { useAuth } from './useAuth';
|
||||
import { useToast } from './use-toast';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { getErrorMessage, handleNonCriticalError } from '@/lib/errorHandler';
|
||||
import { getSubmissionTypeLabel } from '@/lib/moderation/entities';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
@@ -358,9 +358,14 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch((parseError) => {
|
||||
logger.warn('Failed to parse claim error response', {
|
||||
error: getErrorMessage(parseError),
|
||||
status: response.status
|
||||
handleNonCriticalError(parseError, {
|
||||
action: 'Parse claim error response',
|
||||
userId: user.id,
|
||||
metadata: {
|
||||
submissionId,
|
||||
httpStatus: response.status,
|
||||
context: 'claim_submission_error_parsing'
|
||||
}
|
||||
});
|
||||
return { message: 'Failed to claim submission' };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user