Some errors returned from Supabase are PostgrestErrors. These errors don't include typical HTTP status code, but instead their own format which gets translated into a HTTP status code.
- eg. PGRST001 = code: 503, message: Could not connect with the database due to an internal error.
Create a function/mapping to return the appropriate status code and message from a given PostgrestError code based on their chart.
https://docs.postgrest.org/en/v12/references/errors.html#errors-from-postgrest