You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using supabase_client.functions.invoke("function-name") and the edge-function return a custom error code like 403 with a body like {"error":"Unauthorized"}, the raised exception override the status code to 400, only the error message can be retrieved from the original server response.
In more details:
The function-py sub-lib raise a FunctionsHttpError here when the response is not 200 (as expected):
Bug report
Describe the bug
When using
supabase_client.functions.invoke("function-name")
and the edge-function return a custom error code like403
with a body like{"error":"Unauthorized"}
, the raised exception override the status code to400
, only the error message can be retrieved from the original server response.In more details:
The
function-py
sub-lib raise aFunctionsHttpError
here when the response is not200
(as expected):functions-py/supabase_functions/_sync/functions_client.py
Line 57 in 082653b
But the
FunctionsHttpError
have an hardcoded status code of400
here:functions-py/supabase_functions/errors.py
Line 32 in 082653b
To Reproduce
Create an edge-function that return a custom error code and invoke it from supabase-py lib:
Expected behavior
The
FunctionsHttpError
exception should be configured with the real status code from the edge-function response.Screenshots
System information
The text was updated successfully, but these errors were encountered: