mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 08:11:13 -05:00
Connect to Lovable Cloud
Add centralized errorFormatter to convert various error types into readable messages, and apply it across edge functions. Replace String(error) usage with formatEdgeError, update relevant imports, fix a throw to use toError, and enhance logger to log formatted errors. Includes new errorFormatter.ts and widespread updates to 18+ edge functions plus logger integration.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2';
|
||||
import { edgeLogger } from '../_shared/logger.ts';
|
||||
import { formatEdgeError } from '../_shared/errorFormatter.ts';
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -183,7 +184,7 @@ Deno.serve(async (req) => {
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
edgeLogger.error('Cleanup job failed', { error: error instanceof Error ? error.message : String(error) });
|
||||
edgeLogger.error('Cleanup job failed', { error: formatEdgeError(error) });
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user