mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 20:11:14 -05:00
feat: Complete app-wide error coverage
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
import { supabase } from '@/lib/supabaseClient';
|
||||
import type { EntityType } from '@/types/versioning';
|
||||
import { createTableQuery } from './supabaseHelpers';
|
||||
import { logger } from './logger';
|
||||
import { handleNonCriticalError } from './errorHandler';
|
||||
|
||||
/**
|
||||
* Manually trigger cleanup of old versions for a specific entity type
|
||||
@@ -38,7 +38,10 @@ export async function cleanupVersions(
|
||||
});
|
||||
|
||||
if (error) {
|
||||
logger.error('Version cleanup failed', { error, entityType, keepCount });
|
||||
handleNonCriticalError(error, {
|
||||
action: 'Version cleanup',
|
||||
metadata: { entityType, keepCount }
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -98,7 +101,10 @@ export async function getVersionStats(
|
||||
const { data, error } = result;
|
||||
|
||||
if (error || !data) {
|
||||
logger.error('Failed to fetch version stats', { error, entityType, entityId });
|
||||
handleNonCriticalError(error || new Error('No data returned'), {
|
||||
action: 'Fetch version stats',
|
||||
metadata: { entityType, entityId }
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user