Browse Source

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

Claude 5 tháng trước cách đây
mục cha
commit
ec0aecb44e
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  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' } }
     )
 
+  } 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' } }
+    )
+  }
 }))