Browse Source

fix: add missing catch block to webhooks-shopify Edge Function #98

The webhooks-shopify function had a try block without a corresponding
catch block, causing deployment to fail with "Expression expected" error.
Added proper error handling with logError.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 5 months ago
parent
commit
b5be197869
1 changed files with 8 additions and 0 deletions
  1. 8 0
      supabase/functions/webhooks-shopify/index.ts

+ 8 - 0
supabase/functions/webhooks-shopify/index.ts

@@ -373,4 +373,12 @@ serve(wrapHandler('webhooks-shopify', async (req) => {
       { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
     )
 
+  } catch (error) {
+    logError('webhooks-shopify', error as Error, { method: req.method })
+    return new Response(
+      JSON.stringify({ error: 'Internal server error' }),
+      { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
+    )
+  }
 }))
+