@@ -230,5 +230,11 @@ serve(wrapHandler('trigger-sync', async (req) => {
}),
{ status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
)
-
+ } catch (error) {
+ logError('trigger-sync', error as Error, { store_id: req.json() })
+ return new Response(
+ JSON.stringify({ error: 'Internal server error' }),
+ { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
+ )
+ }
}))