ソースを参照

fix: add missing catch blocks in shoprenter-orders and shoprenter-customers #79

Claude 5 ヶ月 前
コミット
6f384258a6

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

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

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

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