Преглед изворни кода

fix: add missing catch block in shoprenter-sync #77

Claude пре 5 месеци
родитељ
комит
ec0aecb44e
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      supabase/functions/shoprenter-sync/index.ts

+ 10 - 0
supabase/functions/shoprenter-sync/index.ts

@@ -576,4 +576,14 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
       { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
       { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
     )
     )
 
 
+  } catch (error: any) {
+    console.error('[ShopRenter] Sync error:', error)
+    return new Response(
+      JSON.stringify({
+        error: 'Sync failed',
+        message: error.message
+      }),
+      { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
+    )
+  }
 }))
 }))