Browse Source

fix: syntax error in trigger-sync - add missing catch block #75

Claude 5 months ago
parent
commit
ea995a9cb6
1 changed files with 7 additions and 1 deletions
  1. 7 1
      supabase/functions/trigger-sync/index.ts

+ 7 - 1
supabase/functions/trigger-sync/index.ts

@@ -230,5 +230,11 @@ serve(wrapHandler('trigger-sync', async (req) => {
       }),
       { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
     )
-
+  } catch (error) {
+    logError('trigger-sync', error as Error, { store_id: req.json() })
+    return new Response(
+      JSON.stringify({ error: 'Internal server error' }),
+      { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
+    )
+  }
 }))