Bug report
Describe the bug
When I try to return an error response I get this error:
FunctionsHttpError: Edge Function returned a non-2xx status code
but the response body that I sent from the function is not included.
I try to return the error like this:
...
} catch (error) {
return new Response(JSON.stringify({
error: error.message
}), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
status: 500,
})
}
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Setup a new edge function with a non 200 response
- Start function local
- try to call the function via the supabase sdk
- See the error
Expected behavior
I expected to get the error message back that I set in the response body.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: macOS
- Browser: chrome
- Version of supabase-js: 2.8.0
- Version of Node.js: 19.6.0
Additional context
Add any other context about the problem here.
Bug report
Describe the bug
When I try to return an error response I get this error:
FunctionsHttpError: Edge Function returned a non-2xx status code
but the response body that I sent from the function is not included.
I try to return the error like this:
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
I expected to get the error message back that I set in the response body.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.