© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
3 replies
Idris

Meaningless errors from supabase edge functions

In my edge function i throw a error like this:
        return new Response(
            JSON.stringify({
                error: {
                    http_code: errorCode,
                    message: errorMessage
                }
            }),
            {
                status: errorCode,
                headers: { ...corsHeaders, 'Content-Type': 'application/json' }
            }
        );
        return new Response(
            JSON.stringify({
                error: {
                    http_code: errorCode,
                    message: errorMessage
                }
            }),
            {
                status: errorCode,
                headers: { ...corsHeaders, 'Content-Type': 'application/json' }
            }
        );


In my app I catch it
            const { data, error } = await supabase.functions.invoke('user-management/create-user', {
                body: requestData
            });

            if (error) {
                console.log(error);
            const { data, error } = await supabase.functions.invoke('user-management/create-user', {
                body: requestData
            });

            if (error) {
                console.log(error);

but the errors are very meaningless its always
FunctionsHttpError: Edge Function returned a non-2xx status code
FunctionsHttpError: Edge Function returned a non-2xx status code


How can I get a usefull error from the SDK, so the message of the error.|

The response does correctly contain the error if i look in the network tab
{
    "error": {
        "http_code": 500,
        "message": "A user with this email address has already been registered"
    }
}
{
    "error": {
        "http_code": 500,
        "message": "A user with this email address has already been registered"
    }
}
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase Edge Functions authentication
SupabaseSSupabase / help-and-questions
2w ago
Edge functions supabase error
SupabaseSSupabase / help-and-questions
5mo ago
Supabase edge functions REST API
SupabaseSSupabase / help-and-questions
4mo ago
Supabase Edge Functions not updating
SupabaseSSupabase / help-and-questions
11mo ago