Skip to content

Map PostgrestError codes into HTTP Status Codes #660

@suzuhe481

Description

@suzuhe481

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions