Просмотр исходного кода

fix: add missing try-catch block in webhook-shoprenter-uninstall #96

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 5 месяцев назад
Родитель
Сommit
5e4e9657df
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      supabase/functions/webhook-shoprenter-uninstall/index.ts

+ 8 - 0
supabase/functions/webhook-shoprenter-uninstall/index.ts

@@ -181,4 +181,12 @@ serve(wrapHandler('webhook-shoprenter-uninstall', async (req) => {
       { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
     )
 
+  } catch (error) {
+    console.error('[ShopRenter] Uninstall webhook error:', error)
+    // Still return 200 to prevent retries
+    return new Response(
+      JSON.stringify({ message: 'Internal error' }),
+      { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
+    )
+  }
 }))