Skip to content

Support throwing errors instead of returning them #1020

Open
@soedirgo

Description

@soedirgo

Feature request

Describe the feature

Add a throwOnError client option to have errors be thrown instead of returning it. As an example, right now we do:

const auth = new AuthClient({ url: AUTH_URL })
const { data, error } = await auth.signUp({ email: '[email protected]', password: 'foobar' })

But with throwOnError we do:

const auth = new AuthClient({ url: AUTH_URL, throwOnError: true })
const { data } = await auth.signUp({ email: '[email protected]', password: 'foobar' })

Additional context

Follows supabase/postgrest-js#188 & supabase/postgrest-js#248

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions