How to return an error from an edge function
I'm trying to handle errors from edge functions correctly on the client.
The docs show to return:
https://github.com/supabase/examples/blob/main/supabase-js-v1/edge-functions/supabase/functions/stripe-webhooks/index.ts
Basic edge function:
Client:
Client result:
Expected result: error to be not null
The docs show to return:
return new Response(err.message, { status: 400 })https://github.com/supabase/examples/blob/main/supabase-js-v1/edge-functions/supabase/functions/stripe-webhooks/index.ts
Basic edge function:
Client:
Client result:
Test Result: {} nullExpected result: error to be not null

GitHub
Supabase examples to help you get started. Contribute to supabase/examples development by creating an account on GitHub.